Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
b1eb33c
version: begin v1.16.5 release cycle
fjl Sep 26, 2025
a8f7965
internal/ethapi: fix outdated comments (#32751)
wit765 Sep 26, 2025
2e2fece
ethapi: reject oversize storage keys before hex decode (#32750)
MatusKysel Sep 26, 2025
16b735f
signer/core: fix TestSignTx to decode res2 (#32749)
VolodymyrBg Sep 26, 2025
8e87b75
trie: correct error messages for UpdateStorage operations (#32746)
MozirDmitriy Sep 26, 2025
c984d90
eth/tracers/native: add keccak256preimage tracer (#32569)
draganm Sep 26, 2025
b19452d
params: add amsterdam fork config (#32687)
MariusVanDerWijden Sep 26, 2025
943a30d
build: remove duplicated func FileExist (#32768)
cuiweixie Sep 29, 2025
265db06
eth/catalyst: check osaka in engine_getBlobsV1 (#32731)
jsvisa Sep 29, 2025
c5a1c35
trie: fix error message in test (#32772)
VolodymyrBg Sep 29, 2025
4b08020
internal/ethapi: remove redundant check in test (#32760)
GarmashAlex Sep 29, 2025
46b7e78
cmd/evm/internal/t8ntool: panic on database corruption (#32776)
CPerezz Sep 29, 2025
ea28346
params: fix bpo config comments (#32755)
lightclient Sep 29, 2025
1cfe624
core/rawdb: update comments (#32668)
VolodymyrBg Sep 29, 2025
891bbad
params: implement String() method for ChainConfig (#32766)
futreall Sep 29, 2025
01d0ce0
params: add blob config information in the banner (#32771)
rjl493456442 Sep 30, 2025
c1e9d78
core/txpool: remove unused signer field from TxPool (#32787)
MozirDmitriy Sep 30, 2025
2037c53
core/state: correct expected value in TestMessageCallGas (#32780)
Galoretka Sep 30, 2025
6f8e28b
go.mod, cmd/keeper/go.mod: upgrade victoria metrics dependency (#32720)
gballet Sep 30, 2025
9986270
eth/catalyst: extend payloadVersion support to osaka/post-osaka forks…
yysung1123 Sep 30, 2025
f9756bb
p2p: fix error message in test (#32804)
zach871 Sep 30, 2025
bb00d26
signer/core: fix error message in test (#32807)
zach871 Sep 30, 2025
1487a85
params: fix banner message (#32796)
zach871 Sep 30, 2025
0576671
core/types, trie: reduce allocations in derivesha (#30747)
holiman Oct 1, 2025
f0dc47a
p2p/enode: fix discovery AyncFilter deadlock on shutdown (#32572)
zzzckck Oct 2, 2025
fc8c8c1
core: refactor StateProcessor to accept ChainContext interface (#32739)
hero5512 Oct 2, 2025
4927e89
p2p/enode: fix asyncfilter comment (#32823)
cskiraly Oct 2, 2025
1e4b39e
trie: cleaner array concatenation (#32756)
hero5512 Oct 2, 2025
477ee58
internal/ethapi: add timestamp to logs in eth_simulate (#32831)
deffrian Oct 6, 2025
ee30982
build: faster gh actions workflow, no ubuntu on appveyor (#32829)
s1na Oct 7, 2025
d67037a
cmd/devp2p/internal/ethtest: update to PoS-only test chain (#32850)
fjl Oct 8, 2025
168d699
core/rawdb: remove duplicated type storedReceiptRLP (#32820)
sashass1315 Oct 8, 2025
064ab70
eth/protocols/eth: use BlockChain interface in Handshake (#32847)
ngotchac Oct 8, 2025
e42af53
cmd/devp2p/internal/ethtest: accept responses in any order (#32834)
flcl42 Oct 8, 2025
695c144
core/rawdb: correct misleading comments for state history accessors (…
phrwlk Oct 9, 2025
a1b8e48
eth/filters: terminate pending tx subscription on error (#32794)
CertiK-Geth Oct 9, 2025
1120855
eth/filters: add `transactionReceipts` subscription (#32697)
10gic Oct 9, 2025
4d6d5a3
core/txpool/legacypool: fix validTxMeter to count transactions (#32845)
cskiraly Oct 10, 2025
ed264a1
eth/protocols/snap: optimize incHash (#32748)
cuiweixie Oct 10, 2025
de24450
core/rawdb, triedb/pathdb: introduce trienode history (#32596)
rjl493456442 Oct 10, 2025
659342a
ethclient: add SubscribeTransactionReceipts (#32869)
10gic Oct 10, 2025
a3aae29
node: fix error condition in gzipResponseWriter.init() (#32896)
lukema95 Oct 13, 2025
2010781
core/types: optimize MergeBloom by using bitutil (#32882)
cuiweixie Oct 13, 2025
85e9977
p2p: rm unused var seedMinTableTime (#32876)
jsvisa Oct 13, 2025
bc0a21a
eth/filters: uninstall subscription in filter apis on error (#32894)
hyeonLewis Oct 13, 2025
a7359ce
triedb, core/rawdb: implement the partial read in freezer (#32132)
jsvisa Oct 13, 2025
5c6ba6b
p2p/enode: optimize LogDist (#32887)
cuiweixie Oct 13, 2025
b87581f
p2p/enode: optimize DistCmp (#32888)
cuiweixie Oct 13, 2025
7b693ea
core/txpool/legacypool: move queue out of main txpool (#32270)
MariusVanDerWijden Oct 13, 2025
b28241b
cmd/workload: filter fuzzer test (#31613)
zsfelfoldi Oct 13, 2025
6337577
p2p/discover: wait for bootstrap to be done (#32881)
jsvisa Oct 13, 2025
52c484d
triedb/pathdb: catch int conversion overflow in 32-bit (#32899)
gballet Oct 14, 2025
00f6f2b
eth/catalyst: remove useless log on enabling Engine API (#32901)
cskiraly Oct 14, 2025
fb8d229
eth: do not warn on switching from snap sync to full sync (#32900)
cskiraly Oct 14, 2025
e03d97a
core/txpool/legacypool: fix pricedList updates (#32906)
rjl493456442 Oct 14, 2025
55a5320
accounts/abi: check presence of payable fallback or receive before pr…
cuiweixie Oct 14, 2025
f6064f3
internal/ethapi: convert legacy blobtx proofs in sendRawTransaction (…
fjl Oct 14, 2025
3cfc334
rpc: fix flaky test TestServerWebsocketReadLimit (#32889)
mishraa-G Oct 15, 2025
40505a9
eth/protocols/eth: reject message containing duplicated txs and drop …
jsvisa Oct 15, 2025
7c107c2
p2p/discover: remove hot-spin in table refresh trigger (#32912)
fjl Oct 15, 2025
32ccb54
version: release go-ethereum v1.16.5 stable
fjl Oct 16, 2025
737ffd1
Merge branch 'master' into release/1.16
fjl Oct 16, 2025
367b5fb
version: begin v1.16.6 release cycle
fjl Oct 16, 2025
5c53507
cmd/geth: log current key in expandVerkle instead of keylist[0] (#32689)
Galoretka Oct 16, 2025
c37bd67
ethclient: add support for eth_simulateV1 (#32856)
hero5512 Oct 16, 2025
ff54ca0
internal/ethapi: add eth_SendRawTransactionSync (#32830)
aodhgan Oct 16, 2025
b373d79
core/state: state copy bugfixes with Verkle Trees (#31696)
yazzaoui Oct 16, 2025
0a2c21a
eth/ethconfig : fix eth generate config (#32929)
ucwong Oct 17, 2025
342285b
eth, internal: add blob conversion for SendRawTransactionSync (#32930)
rjl493456442 Oct 17, 2025
0ec6327
cmd/utils: use maximum uint64 value for receipt chain insertion (#32934)
CertiK-Geth Oct 18, 2025
a9e6626
eth/fetcher: add metrics for tracking slow peers (#32964)
healthykim Oct 20, 2025
88576c5
eth/fetcher: remove dangling peers from alternates (#32947)
healthykim Oct 20, 2025
11c0fb9
triedb/pathdb: fix index out of range panic in decodeSingle (#32937)
hero5512 Oct 20, 2025
69df6bb
core/types: prealloc map in HashDifference as in TxDifference (#32946)
cuiweixie Oct 20, 2025
cfb3111
eth/filters: avoid rebuild the hash map multi times (#32965)
mask-pp Oct 20, 2025
b6a4ac9
core/vm: don't call SetCode after contract creation if initcode didn'…
jwasinger Oct 20, 2025
b1809d1
cmd/keeper: use the ziren keccak precompile (#32816)
gballet Oct 20, 2025
b81f03e
params: enable osaka on dev mode (#32917)
MariusVanDerWijden Oct 20, 2025
d73bfeb
core/txpool: Initialize journal writer for tx tracker (#32921)
KyrinCode Oct 21, 2025
79b6a56
core/state: prevent SetCode hook if contract code is not changed (#32…
rjl493456442 Oct 21, 2025
0a8b820
triedb/pathdb: make batch with pre-allocated size (#32914)
rjl493456442 Oct 21, 2025
407d9fa
cmd/geth: add flag to set genesis (#32844)
lightclient Oct 21, 2025
6608a2a
core/types: remove unused `ErrInvalidTxType` var (#32989)
cuiweixie Oct 21, 2025
3b80752
core/state: fix the flaky TestSizeTracker (#32993)
jsvisa Oct 22, 2025
116c916
cmd/devp2p: distinguish the jwt in devp2p and geth (#32972)
jsvisa Oct 22, 2025
2bb3d9a
p2p: silence on listener shutdown (#33001)
jsvisa Oct 23, 2025
030cd2d
cmd/utils: use IsHexAddress method (#32997)
mask-pp Oct 23, 2025
f1be215
crypto: implement ziren keccak state (#32996)
gballet Oct 23, 2025
0413af4
rpc: fix a flaky test of the websocket (#33002)
jsvisa Oct 23, 2025
53c85da
eth/tracers: fix crasher in TraceCall with BlockOverrides (#33015)
hero5512 Oct 24, 2025
074d7b7
.gitea/workflows, build: add release build for keeper (#32632)
gballet Oct 24, 2025
17e5222
build: fix keeper build (#33018)
fjl Oct 24, 2025
cfa3b96
core/rawdb, triedb/pathdb: re-structure the trienode history header (…
rjl493456442 Oct 25, 2025
7fb91f3
rpc: remove unused vars (#33012)
rizkyikiw42 Oct 26, 2025
078a5ec
core/state: improve accessList copy (#33024)
cuiweixie Oct 26, 2025
447b5f7
core: don't modify the shared chainId between tests (#33020)
jsvisa Oct 27, 2025
33dbd64
core/types: optimize modernSigner.Equal (#32971)
cuiweixie Oct 27, 2025
b1db341
core: refine condition for using legacy chain freezer directory (#33032)
jsvisa Oct 28, 2025
59d08c6
internal/jsre: pass correct args to setTimeout/setInterval callbacks …
anim001k Oct 28, 2025
739f6f4
.github: add 32-bit CI targets (#32911)
gballet Oct 28, 2025
ae37b49
accounts/abi/bind/v2: fix error assertion in test (#33041)
alarso16 Oct 29, 2025
5dd0fe2
p2p: cleanup v4 if v5 failed (#33005)
jsvisa Oct 29, 2025
ccacbd1
common: simplify FileExist helper (#32969)
MamunC0der Oct 30, 2025
243407a
eth/downloader: fix incorrect waitgroup in test `XTestDelivery` (#33047)
wit765 Oct 30, 2025
e6d34c1
eth/tracers: fix prestateTracer for EIP-6780 SELFDESTRUCT (#33050)
hero5512 Oct 31, 2025
18a9027
common: fix duration comparison in PrettyAge (#33064)
maradini77 Nov 1, 2025
28c59b7
core/rawdb: fix db inspector by supporting trienode history (#33087)
rjl493456442 Nov 3, 2025
0250724
params: set osaka and BPO1 & BPO2 mainnet dates (#33063)
MariusVanDerWijden Nov 3, 2025
044828e
version: release go-ethereum v1.16.6
fjl Nov 3, 2025
386c3de
Merge branch 'master' into release/1.16
fjl Nov 3, 2025
5b77af3
version: begin v1.16.7 release cycle
fjl Nov 3, 2025
653f8d4
go.mod: update to c-kzg v2.1.5 (#33093)
MariusVanDerWijden Nov 4, 2025
07129d2
version: release go-ethereum v1.16.7 stable
fjl Nov 4, 2025
b9f3a3d
Merge branch 'master' into release/1.16
fjl Nov 4, 2025
c36f777
Merge commit '737ffd1bf0cbee378d0111a5b17ae4724fb2216c' into merge_v1…
amsanghi Nov 6, 2025
8903d53
Merge commit '386c3de6c45f3e185279e6760a17f88fb98dc81a' into merge_v1…
amsanghi Nov 6, 2025
eb183d5
Merge tag 'v1.16.7' into merge_v1.16.7
amsanghi Nov 6, 2025
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
21 changes: 21 additions & 0 deletions .gitea/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,27 @@ jobs:
LINUX_SIGNING_KEY: ${{ secrets.LINUX_SIGNING_KEY }}
AZURE_BLOBSTORE_TOKEN: ${{ secrets.AZURE_BLOBSTORE_TOKEN }}

keeper:
name: Keeper Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.24
cache: false

- name: Install cross toolchain
run: |
apt-get update
apt-get -yq --no-install-suggests --no-install-recommends install gcc-multilib

- name: Build (amd64)
run: |
go run build/ci.go keeper -dlgo

windows:
name: Windows Build
runs-on: "win-11"
Expand Down
47 changes: 44 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
lint:
if: false # not supported on OffchainLabs fork, ci.yml is used instead
name: Lint
runs-on: self-hosted-ghr
runs-on: [self-hosted-ghr, size-s-x64]
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -35,11 +35,52 @@
go run build/ci.go check_generate
go run build/ci.go check_baddeps
keeper:
name: Keeper Builds
needs: test
runs-on: [self-hosted-ghr, size-l-x64]
steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
cache: false

- name: Build
run: go run build/ci.go keeper

test-32bit:
Comment on lines +39 to +56

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 4 days ago

The best way to fix this problem is to explicitly declare a top-level permissions block in the workflow (i.e., directly below the name: and on: keys, before jobs:). This will apply least-privilege permissions (usually contents: read) to all jobs—including keeper—unless a job defines its own permissions block, which none do in this workflow. To implement the fix, add:

permissions:
  contents: read

above or below the on: block, before jobs:.

No other changes are required since none of the jobs perform operations that require write access. No new imports or definitions are needed, and this change is limited to .github/workflows/go.yml, preserved within YAML workflow conventions.

Suggested changeset 1
.github/workflows/go.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
--- a/.github/workflows/go.yml
+++ b/.github/workflows/go.yml
@@ -7,6 +7,9 @@
       - master
   workflow_dispatch:
 
+permissions:
+  contents: read
+
 jobs:
   lint:
     if: false # not supported on OffchainLabs fork, ci.yml is used instead
EOF
@@ -7,6 +7,9 @@
- master
workflow_dispatch:

permissions:
contents: read

jobs:
lint:
if: false # not supported on OffchainLabs fork, ci.yml is used instead
Copilot is powered by AI and may make mistakes. Always verify output.
name: "32bit tests"
needs: test
runs-on: [self-hosted-ghr, size-l-x64]
steps:
- uses: actions/checkout@v4
with:
submodules: false

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
cache: false

- name: Install cross toolchain
run: |
apt-get update
apt-get -yq --no-install-suggests --no-install-recommends install gcc-multilib
- name: Build
run: go run build/ci.go test -arch 386 -short -p 8

test:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
if: false # not supported on OffchainLabs fork, ci.yml is used instead
name: Test
needs: lint
runs-on: self-hosted-ghr
runs-on: [self-hosted-ghr, size-l-x64]
strategy:
matrix:
go:
Expand All @@ -57,4 +98,4 @@
cache: false

- name: Run tests
run: go run build/ci.go test
run: go run build/ci.go test -p 8
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@ cmd/ethkey/ethkey
cmd/evm/evm
cmd/geth/geth
cmd/rlpdump/rlpdump
cmd/workload/workload
cmd/workload/workload
cmd/keeper/keeper
6 changes: 3 additions & 3 deletions accounts/abi/abigen/bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,13 +485,13 @@ var bindTests = []struct {
contract Defaulter {
address public caller;

function() {
fallback() external payable {
caller = msg.sender;
}
}
`,
[]string{`6060604052606a8060106000396000f360606040523615601d5760e060020a6000350463fc9c8d3981146040575b605e6000805473ffffffffffffffffffffffffffffffffffffffff191633179055565b606060005473ffffffffffffffffffffffffffffffffffffffff1681565b005b6060908152602090f3`},
[]string{`[{"constant":true,"inputs":[],"name":"caller","outputs":[{"name":"","type":"address"}],"type":"function"}]`},
[]string{`608060405234801561000f575f80fd5b5061013d8061001d5f395ff3fe608060405260043610610021575f3560e01c8063fc9c8d391461006257610022565b5b335f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055005b34801561006d575f80fd5b5061007661008c565b60405161008391906100ee565b60405180910390f35b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100d8826100af565b9050919050565b6100e8816100ce565b82525050565b5f6020820190506101015f8301846100df565b9291505056fea26469706673582212201e9273ecfb1f534644c77f09a25c21baaba81cf1c444ebc071e12a225a23c72964736f6c63430008140033`},
[]string{`[{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"caller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]`},
`
"math/big"

Expand Down
6 changes: 4 additions & 2 deletions accounts/abi/bind/v2/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,10 @@ func (c *BoundContract) RawCreationTransact(opts *TransactOpts, calldata []byte)
// Transfer initiates a plain transaction to move funds to the contract, calling
// its default method if one is available.
func (c *BoundContract) Transfer(opts *TransactOpts) (*types.Transaction, error) {
// todo(rjl493456442) check the payable fallback or receive is defined
// or not, reject invalid transaction at the first place
// Check if payable fallback or receive is defined
if !c.abi.HasReceive() && !(c.abi.HasFallback() && c.abi.Fallback.IsPayable()) {
return nil, fmt.Errorf("contract does not have a payable fallback or receive function")
}
return c.transact(opts, &c.address, nil)
}

Expand Down
5 changes: 2 additions & 3 deletions accounts/abi/bind/v2/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,9 @@ func TestWaitDeployedCornerCases(t *testing.T) {
done := make(chan struct{})
go func() {
defer close(done)
want := errors.New("context canceled")
_, err := bind.WaitDeployed(ctx, backend.Client(), tx.Hash())
if err == nil || errors.Is(want, err) {
t.Errorf("error mismatch: want %v, got %v", want, err)
if !errors.Is(err, context.Canceled) {
t.Errorf("error mismatch: want %v, got %v", context.Canceled, err)
}
}()

Expand Down
20 changes: 0 additions & 20 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ clone_depth: 5
version: "{branch}.{build}"

image:
- Ubuntu
- Visual Studio 2019

environment:
Expand All @@ -17,25 +16,6 @@ install:
- go version

for:
# Linux has its own script without -arch and -cc.
# The linux builder also runs lint.
- matrix:
only:
- image: Ubuntu
build_script:
- go run build/ci.go lint
- go run build/ci.go check_generate
- go run build/ci.go check_baddeps
- go run build/ci.go install -dlgo
test_script:
- go run build/ci.go test -dlgo -short

# linux/386 is disabled.
- matrix:
exclude:
- image: Ubuntu
GETH_ARCH: 386

# Windows builds for amd64 + 386.
- matrix:
only:
Expand Down
8 changes: 8 additions & 0 deletions arbitrum/apibackend.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ type APIBackend struct {
sync SyncProgressBackend
}

func (a *APIBackend) RPCTxSyncDefaultTimeout() time.Duration {
return a.b.config.TxSyncDefaultTimeout
}

func (a *APIBackend) RPCTxSyncMaxTimeout() time.Duration {
return a.b.config.TxSyncMaxTimeout
}

type errorFilteredFallbackClient struct {
impl types.FallbackClient
url string
Expand Down
9 changes: 9 additions & 0 deletions arbitrum/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ type Config struct {

BlockRedirects []BlockRedirectConfig `koanf:"block-redirects"`
BlockRedirectsList string `koanf:"block-redirects-list"`

// EIP-7966: eth_sendRawTransactionSync timeouts
TxSyncDefaultTimeout time.Duration `koanf:"tx-sync-default-timeout"`
TxSyncMaxTimeout time.Duration `koanf:"tx-sync-max-timeout"`
}

type BlockRedirectConfig struct {
Expand Down Expand Up @@ -94,6 +98,8 @@ func ConfigAddOptions(prefix string, f *flag.FlagSet) {
f.Uint64(prefix+".arbdebug.block-range-bound", arbDebug.BlockRangeBound, "bounds the number of blocks arbdebug calls may return")
f.Uint64(prefix+".arbdebug.timeout-queue-bound", arbDebug.TimeoutQueueBound, "bounds the length of timeout queues arbdebug calls may return")
f.String(prefix+".block-redirects-list", DefaultConfig.BlockRedirectsList, "array of node configs to redirect block requests given as a json string. time duration should be supplied in number indicating nanoseconds")
f.Duration(prefix+".tx-sync-default-timeout", DefaultConfig.TxSyncDefaultTimeout, "default timeout for eth_sendRawTransactionSync")
f.Duration(prefix+".tx-sync-max-timeout", DefaultConfig.TxSyncMaxTimeout, "maximum allowed timeout for eth_sendRawTransactionSync ")
}

const (
Expand Down Expand Up @@ -121,4 +127,7 @@ var DefaultConfig = Config{
},
BlockRedirectsList: "default",
StateScheme: rawdb.HashScheme,
// EIP-7966: eth_sendRawTransactionSync timeouts
TxSyncDefaultTimeout: ethconfig.Defaults.TxSyncDefaultTimeout,
TxSyncMaxTimeout: ethconfig.Defaults.TxSyncMaxTimeout,
}
29 changes: 29 additions & 0 deletions arbitrum/recordingdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,35 @@ func (r *RecordingChainContext) GetMinBlockNumberAccessed() uint64 {
return r.minBlockNumberAccessed
}

func (r *RecordingChainContext) CurrentHeader() *types.Header {
header := r.bc.CurrentHeader()
if header != nil {
num := header.Number.Uint64()
if num < r.minBlockNumberAccessed {
r.minBlockNumberAccessed = num
}
}
return header
}

func (r *RecordingChainContext) GetHeaderByNumber(number uint64) *types.Header {
if number < r.minBlockNumberAccessed {
r.minBlockNumberAccessed = number
}
return r.bc.GetHeaderByNumber(number)
}

func (r *RecordingChainContext) GetHeaderByHash(hash common.Hash) *types.Header {
header := r.bc.GetHeaderByHash(hash)
if header != nil {
num := header.Number.Uint64()
if num < r.minBlockNumberAccessed {
r.minBlockNumberAccessed = num
}
}
return header
}

type RecordingDatabaseConfig struct {
TrieDirtyCache int
TrieCleanCache int
Expand Down
4 changes: 4 additions & 0 deletions beacon/params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ func (c *ChainConfig) LoadForks(file []byte) error {
switch version := value.(type) {
case int:
versions[name] = new(big.Int).SetUint64(uint64(version)).FillBytes(make([]byte, 4))
case int64:
versions[name] = new(big.Int).SetUint64(uint64(version)).FillBytes(make([]byte, 4))
case uint64:
versions[name] = new(big.Int).SetUint64(version).FillBytes(make([]byte, 4))
case string:
Expand All @@ -125,6 +127,8 @@ func (c *ChainConfig) LoadForks(file []byte) error {
switch epoch := value.(type) {
case int:
epochs[name] = uint64(epoch)
case int64:
epochs[name] = uint64(epoch)
case uint64:
epochs[name] = epoch
case string:
Expand Down
Loading
Loading