Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/eth/fee_market.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@
result:
name: Gas price
value: '0x3e8'
- name: eth_baseFee
summary: Returns the base fee per gas in wei.
params: []
result:
name: Base fee
schema:
title: Base fee
$ref: '#/components/schemas/uint'
examples:
- name: eth_baseFee example
params: []
result:
name: Base fee
value: '0x3b9aca00'
- name: eth_blobBaseFee
summary: Returns the base fee per blob gas in wei.
params: []
Expand Down
3 changes: 3 additions & 0 deletions tests/eth_baseFee/get-current-basefee.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// gets the current base fee in wei
>> {"jsonrpc":"2.0","id":1,"method":"eth_baseFee"}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need a pre-london testcase

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. eth_blobBaseFee doesn't have similar coverage; however I agree that this is a good idea.

So, I need to come up with a way to test across different block numbers. My best idea was debug_setHead, but then speccheck fails because debug_setHead is not specified.

If we can agree on a good approach for testing this, I'll also do it for eth_blobBaseFee.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a good approach. But I will not block this PR on its implementation. It is requires some refactoring.

Just to spell it out for future reference: we need to generate a pre-london chain via hivechain (in mkchain.sh) and have tools/testgen be configured to spin up a second node instance with that chain. It would mean also that rpc-compat suite which is currently built around a single chain needs to be refactored to run tests selectively against few chains.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the consensus on pre-london right now? return nil or 0? I'd like to merge the geth PR. This is the only open question.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got consensus with the nethermind team to return nil in that case, matching geth's eth_blobBaseFee. I also updated their eth_blobBaseFee to return nil; it previously returned 0.

<< {"jsonrpc":"2.0","id":1,"result":"0x4c9114a"}
5 changes: 3 additions & 2 deletions tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.25.0
require (
github.com/alexflint/go-arg v1.4.3
github.com/cespare/cp v1.1.1
github.com/ethereum/go-ethereum v1.17.3-0.20260413114535-ecae519972c0
github.com/ethereum/go-ethereum v1.17.4-0.20260519060500-1149f76dca22
github.com/holiman/uint256 v1.3.2
github.com/mattn/go-jsonpointer v0.0.1
github.com/open-rpc/meta-schema v0.0.0-20210416041958-626a15d0a618
Expand Down Expand Up @@ -46,6 +46,7 @@ require (
github.com/emicklei/dot v1.6.2 // indirect
github.com/ethereum/c-kzg-4844/v2 v2.1.6 // indirect
github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab // indirect
github.com/ethereum/hid v1.0.1-0.20260421154323-c2ab8d9bf68a // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/ferranbt/fastssz v0.1.4 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
Expand Down Expand Up @@ -75,7 +76,6 @@ require (
github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c // indirect
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/karalabe/hid v1.0.1-0.20260315100226-f5d04adeffeb // indirect
github.com/kilic/bls12-381 v0.1.0 // indirect
github.com/klauspost/compress v1.17.8 // indirect
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
Expand Down Expand Up @@ -120,6 +120,7 @@ require (
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/otel v1.40.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.40.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.40.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.40.0 // indirect
go.opentelemetry.io/otel/metric v1.40.0 // indirect
go.opentelemetry.io/otel/sdk v1.40.0 // indirect
Expand Down
10 changes: 6 additions & 4 deletions tools/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ github.com/ethereum/c-kzg-4844/v2 v2.1.6 h1:xQymkKCT5E2Jiaoqf3v4wsNgjZLY0lRSkZn2
github.com/ethereum/c-kzg-4844/v2 v2.1.6/go.mod h1:8HMkUZ5JRv4hpw/XUrYWSQNAUzhHMg2UDb/U+5m+XNw=
github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab h1:rvv6MJhy07IMfEKuARQ9TKojGqLVNxQajaXEp/BoqSk=
github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab/go.mod h1:IuLm4IsPipXKF7CW5Lzf68PIbZ5yl7FFd74l/E0o9A8=
github.com/ethereum/go-ethereum v1.17.3-0.20260413114535-ecae519972c0 h1:S9+NVTpdkUWUN5+Idxzg+gxo8d5AQe4C/O6pwFKPuNA=
github.com/ethereum/go-ethereum v1.17.3-0.20260413114535-ecae519972c0/go.mod h1:KHcRXfGOUfUmKg51IhQ0IowiqZ6PqZf08CMtk0g5K1o=
github.com/ethereum/go-ethereum v1.17.4-0.20260519060500-1149f76dca22 h1:CnmrTYrqoLYy985jIpQ+84V9H6JWkVhPMoSXFU3sUrE=
github.com/ethereum/go-ethereum v1.17.4-0.20260519060500-1149f76dca22/go.mod h1:f2EhRwqewIZkGoQekywI2Y2RZAMTSavLNkD9qItFy1A=
github.com/ethereum/hid v1.0.1-0.20260421154323-c2ab8d9bf68a h1:eIFUceK3U/z9UV0D/kAI6cxA27eH7MPqt2ks7fbzj/k=
github.com/ethereum/hid v1.0.1-0.20260421154323-c2ab8d9bf68a/go.mod h1:nABYy4hsKZpuN0mu0uybdjrIOuGb1eE7b1lci/ezUAo=
Comment thread
wjmelements marked this conversation as resolved.
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
github.com/ferranbt/fastssz v0.1.4 h1:OCDB+dYDEQDvAgtAGnTSidK1Pe2tW3nFV40XyMkTeDY=
Expand Down Expand Up @@ -174,8 +176,6 @@ github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 h1:W9WBk7
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo=
github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus=
github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc=
github.com/karalabe/hid v1.0.1-0.20260315100226-f5d04adeffeb h1:Ag83At00qa4FLkcdMgrwHVSakqky/eZczOlxd4q336E=
github.com/karalabe/hid v1.0.1-0.20260315100226-f5d04adeffeb/go.mod h1:qk1sX/IBgppQNcGCRoj90u6EGC056EBoIc1oEjCWla8=
github.com/kilic/bls12-381 v0.1.0 h1:encrdjqKMEvabVQ7qYOKu1OvhqpK4s47wDYtNiPtlp4=
github.com/kilic/bls12-381 v0.1.0/go.mod h1:vDTTHJONJ6G+P2R74EhnyotQDTliQDnFEwhdmfzw1ig=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
Expand Down Expand Up @@ -340,6 +340,8 @@ go.opentelemetry.io/otel v1.40.0 h1:oA5YeOcpRTXq6NN7frwmwFR0Cn3RhTVZvXsP4duvCms=
go.opentelemetry.io/otel v1.40.0/go.mod h1:IMb+uXZUKkMXdPddhwAHm6UfOwJyh4ct1ybIlV14J0g=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.40.0 h1:QKdN8ly8zEMrByybbQgv8cWBcdAarwmIPZ6FThrWXJs=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.40.0/go.mod h1:bTdK1nhqF76qiPoCCdyFIV+N/sRHYXYCTQc+3VCi3MI=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.40.0 h1:DvJDOPmSWQHWywQS6lKL+pb8s3gBLOZUtw4N+mavW1I=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.40.0/go.mod h1:EtekO9DEJb4/jRyN4v4Qjc2yA7AtfCBuz2FynRUWTXs=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.40.0 h1:wVZXIWjQSeSmMoxF74LzAnpVQOAFDo3pPji9Y4SOFKc=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.40.0/go.mod h1:khvBS2IggMFNwZK/6lEeHg/W57h/IX6J4URh57fuI40=
go.opentelemetry.io/otel/metric v1.40.0 h1:rcZe317KPftE2rstWIBitCdVp89A2HqjkxR3c11+p9g=
Expand Down
17 changes: 16 additions & 1 deletion tools/testgen/generators.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ var AllMethods = []MethodTests{
DebugGetRawBlock,
DebugGetRawReceipts,
DebugGetRawTransaction,
EthBaseFee,
EthBlobBaseFee,
NetVersion,
TestingBuildBlockV1,
Expand Down Expand Up @@ -1838,6 +1839,21 @@ var EthMaxPriorityFeePerGas = MethodTests{
},
}

var EthBaseFee = MethodTests{
"eth_baseFee",
[]Test{
{
Name: "get-current-basefee",
About: "gets the current base fee in wei",
Run: func(ctx context.Context, t *T) error {
var result hexutil.Big
err := t.rpc.CallContext(ctx, &result, "eth_baseFee")
return err
},
},
},
}

var EthBlobBaseFee = MethodTests{
"eth_blobBaseFee",
[]Test{
Expand Down Expand Up @@ -6788,4 +6804,3 @@ var TxpoolContentFrom = MethodTests{
},
},
}