diff --git a/.github/generate_change_log.sh b/.github/generate_change_log.sh index b50893ddfa..d7c0a4611d 100755 --- a/.github/generate_change_log.sh +++ b/.github/generate_change_log.sh @@ -6,7 +6,9 @@ change_log_file="./CHANGELOG.md" version="## $@" version_prefix="## v" start=0 +in_meta=0 CHANGE_LOG="" +META_INFO="" while read line; do if [[ $line == *"$version"* ]]; then start=1 @@ -16,7 +18,18 @@ while read line; do break; fi if [ $start == 1 ]; then - CHANGE_LOG+="$line\n" + if [[ $line == "## MetaInfo"* ]]; then + in_meta=1 + continue + fi + if [[ $line == "## "* ]] && [ $in_meta == 1 ]; then + in_meta=0 + fi + if [ $in_meta == 1 ]; then + META_INFO+="$line\n" + else + CHANGE_LOG+="$line\n" + fi fi done < ${change_log_file} MAINNET_ZIP_SUM="$(checksum ./mainnet.zip)" @@ -26,6 +39,8 @@ MAC_BIN_SUM="$(checksum ./macos/geth)" WINDOWS_BIN_SUM="$(checksum ./windows/geth.exe)" ARM64_BIN_SUM="$(checksum ./arm64/geth-linux-arm64)" OUTPUT=$(cat <<-END +## MetaInfo\n +${META_INFO}\n ## Changelog\n ${CHANGE_LOG}\n ## Assets\n @@ -40,4 +55,4 @@ ${CHANGE_LOG}\n END ) -echo -e "${OUTPUT}" \ No newline at end of file +echo -e "${OUTPUT}" diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index 12cb59f985..fd442efb0e 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -19,6 +19,9 @@ jobs: - os: ubuntu-24.04-arm platform_pair: linux-arm64 runs-on: ${{ matrix.os }} + permissions: + contents: read + packages: write steps: - name: Checkout @@ -51,7 +54,7 @@ jobs: with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} - password: ${{ secrets.PACKAGE_TOKEN }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push id: build @@ -76,6 +79,9 @@ jobs: retention-days: 1 merge: runs-on: ubuntu-latest + permissions: + contents: read + packages: write needs: - build steps: @@ -91,7 +97,7 @@ jobs: with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} - password: ${{ secrets.PACKAGE_TOKEN }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 diff --git a/CHANGELOG.md b/CHANGELOG.md index 52978c6ede..8a95991aa7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,43 @@ # Changelog +## v1.7.3 +v1.7.3 is a maintenance release, which mainly fixes kvdb abnormal continuous growth, pls refer change log for detail. + +### BUGFIX +- [\#3633](https://github.com/bnb-chain/bsc/pull/3633) core/rawdb: increase SlowFreezerBatchLimit from 100 to 200, fixing kvdb abnormal continuous growth +- [\#3631](https://github.com/bnb-chain/bsc/pull/3631) core/vote: fix deadlock in votepool when stop client +- [\#3627](https://github.com/bnb-chain/bsc/pull/3627) core/vm: fix super-instruction LT comparison after swap1 + +### FEATURE +- [\#3624](https://github.com/bnb-chain/bsc/pull/3624) cmd/utils: disabled transaction unindexing for archive node by default; when running in archive mode, the `--history.transactions` flag is now respected to specify transaction history range instead of being forced to index all history +- [\#3634](https://github.com/bnb-chain/bsc/pull/3634) eth/ethconfig: set default value to 576000 for history.logs + +### IMPROVEMENT +- [\#3626](https://github.com/bnb-chain/bsc/pull/3626) eth: tune timing parameters and broadcast queue for 450ms block +- [\#3618](https://github.com/bnb-chain/bsc/pull/3618) [\#3629](https://github.com/bnb-chain/bsc/pull/3629) miner: async blob tx validation during bid simulation with worker pool +- [\#3650](https://github.com/bnb-chain/bsc/pull/3650) miner: shrink greedy merge buffer +- [\#3645](https://github.com/bnb-chain/bsc/pull/3645) core: use now for DA check instead of chasingHead.time + +### Others +- [\#3639](https://github.com/bnb-chain/bsc/pull/3639) go.mod: use go1.25.0 and update otel +- [\#3637](https://github.com/bnb-chain/bsc/pull/3637) build(deps): bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp from 1.34.0 to 1.43.0 +- [\#3617](https://github.com/bnb-chain/bsc/pull/3617) build(deps): bump github.com/mattn/go-colorable from 0.1.13 to 0.1.14 +- [\#3616](https://github.com/bnb-chain/bsc/pull/3616) build(deps): bump github.com/gorilla/mux from 1.8.0 to 1.8.1 +- [\#3648](https://github.com/bnb-chain/bsc/pull/3648) Revert ".github: change dependabot target branch to develop" + +## MetaInfo +Mandatory Update Required: No +Target Audience: all BSC Mainnet/Testnet users +Procedure: simply binary replacement should be good from v1.7.x, ensure no 'JournalFileEnabled' field in config file if from v1.6.x +Schedule(Timeline): no scheduled upgrade timeline + +## v1.7.2 +v1.7.2 is for BSC Mainnet [Osaka/Mendel hardfork](https://github.com/bnb-chain/BEPs/blob/master/BEPs/BEP-658.md),the hard fork time is 2026-04-28 02:30:00 AM UTC + +### BUGFIX +- [\#3597](https://github.com/bnb-chain/bsc/pull/3597) miner: support blob sidecar validation for bids +- [\#3590](https://github.com/bnb-chain/bsc/pull/3590) eth: delayed p2p message decoding +- [\#3601](https://github.com/bnb-chain/bsc/pull/3601) core: reject future chasing heads for DA checks + ## v1.7.1 v1.7.1 is for BSC Chapel testnet [Osaka/Mendel hardfork](https://github.com/bnb-chain/BEPs/blob/master/BEPs/BEP-658.md),the hard fork time is 2026-03-24 02:30:00 AM UTC diff --git a/README.md b/README.md index 0206d19b3b..3d638f1d65 100644 --- a/README.md +++ b/README.md @@ -148,10 +148,10 @@ Download latest chaindata snapshot from [here](https://github.com/bnb-chain/bsc- #### 4. Start a full node ```shell ## It will run with Path-Base Storage Scheme by default and enable inline state prune, keeping the latest 600000 blocks' history state. -./geth --config ./config.toml --datadir ./node --cache 8000 --rpc.allow-unprotected-txs --history.transactions 0 --history.logs 576000 +./geth --config ./config.toml --datadir ./node --cache 8000 --rpc.allow-unprotected-txs --history.transactions 0 ## It is recommend to run fullnode with `--tries-verify-mode none` if you want high performance and care little about state consistency. -./geth --config ./config.toml --datadir ./node --cache 8000 --rpc.allow-unprotected-txs --history.transactions 0 --history.logs 576000 --tries-verify-mode none +./geth --config ./config.toml --datadir ./node --cache 8000 --rpc.allow-unprotected-txs --history.transactions 0 --tries-verify-mode none ``` #### 5. Monitor node status diff --git a/cmd/extradump/main.go b/cmd/extradump/main.go index 49fbc73b8f..fe67bb327a 100644 --- a/cmd/extradump/main.go +++ b/cmd/extradump/main.go @@ -12,10 +12,10 @@ import ( "sort" "strings" + "github.com/bits-and-blooms/bitset" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/rlp" - "github.com/willf/bitset" ) // follow define in parlia diff --git a/cmd/keeper/go.mod b/cmd/keeper/go.mod index a78d7ebde9..7938afa95e 100644 --- a/cmd/keeper/go.mod +++ b/cmd/keeper/go.mod @@ -1,6 +1,6 @@ module github.com/ethereum/go-ethereum/cmd/keeper -go 1.24.0 +go 1.25.0 require ( github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251001021608-1fe7b43fc4d6 @@ -25,6 +25,7 @@ require ( github.com/cometbft/cometbft v0.37.0 // indirect github.com/consensys/gnark-crypto v0.18.1 // indirect github.com/cosmos/gogoproto v1.4.1 // indirect + github.com/cosmos/iavl v0.12.0 // indirect github.com/crate-crypto/go-eth-kzg v1.4.0 // indirect github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a // indirect github.com/davecgh/go-spew v1.1.1 // indirect @@ -84,21 +85,20 @@ require ( github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe // indirect github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect github.com/tendermint/go-amino v0.14.1 // indirect - github.com/tendermint/iavl v0.12.0 // indirect github.com/tendermint/tendermint v0.31.15 // indirect github.com/thomaso-mirodin/intmath v0.0.0-20160323211736-5dc6d854e46e // indirect github.com/tklauser/go-sysconf v0.3.13 // indirect github.com/tklauser/numcpus v0.7.0 // indirect github.com/yusufpapurcu/wmi v1.2.3 // indirect - golang.org/x/crypto v0.45.0 // indirect + golang.org/x/crypto v0.49.0 // indirect golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 // indirect - golang.org/x/net v0.47.0 // indirect - golang.org/x/sync v0.18.0 // indirect - golang.org/x/sys v0.40.0 // indirect - golang.org/x/text v0.31.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect - google.golang.org/grpc v1.69.4 // indirect - google.golang.org/protobuf v1.36.3 // indirect + golang.org/x/net v0.52.0 // indirect + golang.org/x/sync v0.20.0 // indirect + golang.org/x/sys v0.42.0 // indirect + golang.org/x/text v0.35.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 // indirect + google.golang.org/grpc v1.80.0 // indirect + google.golang.org/protobuf v1.36.11 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/cmd/keeper/go.sum b/cmd/keeper/go.sum index 9d361bfff9..401c327dff 100644 --- a/cmd/keeper/go.sum +++ b/cmd/keeper/go.sum @@ -58,6 +58,8 @@ github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d h1:49RLWk1j44Xu4fj github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/gogoproto v1.4.1 h1:WoyH+0/jbCTzpKNvyav5FL1ZTWsp1im1MxEpJEzKUB8= github.com/cosmos/gogoproto v1.4.1/go.mod h1:Ac9lzL4vFpBMcptJROQ6dQ4M3pOEK5Z/l0Q9p+LoCr4= +github.com/cosmos/iavl v0.12.0 h1:lcK28rWK6Q/+iKQlMksi/pKnqQZLIdQocSfazSR4fKE= +github.com/cosmos/iavl v0.12.0/go.mod h1:5paARKGkQVKis4t9KbBnXTKdzl+sdDAhR3rIp+iAZzs= github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc= github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/crate-crypto/go-eth-kzg v1.4.0 h1:WzDGjHk4gFg6YzV0rJOAsTK4z3Qkz5jd4RE3DAvPFkg= @@ -283,8 +285,6 @@ github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzH github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tendermint/go-amino v0.14.1 h1:o2WudxNfdLNBwMyl2dqOJxiro5rfrEaU0Ugs6offJMk= github.com/tendermint/go-amino v0.14.1/go.mod h1:i/UKE5Uocn+argJJBb12qTZsCDBcAYMbR92AaJVmKso= -github.com/tendermint/iavl v0.12.0 h1:xcaFAr+ycqCj7WN1RzL2EfcBioRDOHcU1oWcg83K028= -github.com/tendermint/iavl v0.12.0/go.mod h1:EoKMMv++tDOL5qKKVnoIqtVPshRrEPeJ0WsgDOLAauM= github.com/thomaso-mirodin/intmath v0.0.0-20160323211736-5dc6d854e46e h1:cR8/SYRgyQCt5cNCMniB/ZScMkhI9nk8U5C7SbISXjo= github.com/thomaso-mirodin/intmath v0.0.0-20160323211736-5dc6d854e46e/go.mod h1:Tu4lItkATkonrYuvtVjG0/rhy15qrNGNTjPdaphtZ/8= github.com/tklauser/go-sysconf v0.3.13 h1:GBUpcahXSpR2xN01jhkNAbTLRk2Yzgggk8IM08lq3r4= @@ -303,22 +303,22 @@ go.etcd.io/bbolt v1.3.9 h1:8x7aARPEXiXbHmtUwAIv7eV2fQFHrLLavdiJ3uzJXoI= go.etcd.io/bbolt v1.3.9/go.mod h1:zaO32+Ti0PK1ivdPtgMESzuzL2VPoIG1PCQNvOdo/dE= go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= -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/metric v1.40.0 h1:rcZe317KPftE2rstWIBitCdVp89A2HqjkxR3c11+p9g= -go.opentelemetry.io/otel/metric v1.40.0/go.mod h1:ib/crwQH7N3r5kfiBZQbwrTge743UDc7DTFVZrrXnqc= -go.opentelemetry.io/otel/sdk v1.40.0 h1:KHW/jUzgo6wsPh9At46+h4upjtccTmuZCFAc9OJ71f8= -go.opentelemetry.io/otel/sdk v1.40.0/go.mod h1:Ph7EFdYvxq72Y8Li9q8KebuYUr2KoeyHx0DRMKrYBUE= -go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= -go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= -go.opentelemetry.io/otel/trace v1.40.0 h1:WA4etStDttCSYuhwvEa8OP8I5EWu24lkOzp+ZYblVjw= -go.opentelemetry.io/otel/trace v1.40.0/go.mod h1:zeAhriXecNGP/s2SEG3+Y8X9ujcJOTqQ5RgdEJcawiA= +go.opentelemetry.io/otel v1.43.0 h1:mYIM03dnh5zfN7HautFE4ieIig9amkNANT+xcVxAj9I= +go.opentelemetry.io/otel v1.43.0/go.mod h1:JuG+u74mvjvcm8vj8pI5XiHy1zDeoCS2LB1spIq7Ay0= +go.opentelemetry.io/otel/metric v1.43.0 h1:d7638QeInOnuwOONPp4JAOGfbCEpYb+K6DVWvdxGzgM= +go.opentelemetry.io/otel/metric v1.43.0/go.mod h1:RDnPtIxvqlgO8GRW18W6Z/4P462ldprJtfxHxyKd2PY= +go.opentelemetry.io/otel/sdk v1.43.0 h1:pi5mE86i5rTeLXqoF/hhiBtUNcrAGHLKQdhg4h4V9Dg= +go.opentelemetry.io/otel/sdk v1.43.0/go.mod h1:P+IkVU3iWukmiit/Yf9AWvpyRDlUeBaRg6Y+C58QHzg= +go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= +go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= +go.opentelemetry.io/otel/trace v1.43.0 h1:BkNrHpup+4k4w+ZZ86CZoHHEkohws8AY+WTX09nk+3A= +go.opentelemetry.io/otel/trace v1.43.0/go.mod h1:/QJhyVBUUswCphDVxq+8mld+AvhXZLhe+8WVFxiFff0= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q= -golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4= +golang.org/x/crypto v0.49.0 h1:+Ng2ULVvLHnJ/ZFEq4KdcDd/cfjrrjjNSXNzxg0Y4U4= +golang.org/x/crypto v0.49.0/go.mod h1:ErX4dUh2UM+CFYiXZRTcMpEcN8b/1gxEuv3nODoYtCA= golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 h1:1UoZQm6f0P/ZO0w1Ri+f+ifG/gXhegadRdwBIXEFWDo= golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -330,16 +330,16 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= -golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= -golang.org/x/oauth2 v0.27.0 h1:da9Vo7/tDv5RH/7nZDz1eMGS/q1Vv1N/7FCrBhI9I3M= -golang.org/x/oauth2 v0.27.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= +golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0= +golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw= +golang.org/x/oauth2 v0.35.0 h1:Mv2mzuHuZuY2+bkyWXIHMfhNdJAdwW3FuWeCPYN5GVQ= +golang.org/x/oauth2 v0.35.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I= -golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= +golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= +golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -353,15 +353,15 @@ golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ= -golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU= -golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254= +golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo= +golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/term v0.41.0 h1:QCgPso/Q3RTJx2Th4bDLqML4W6iJiaXFq2/ftQF13YU= +golang.org/x/term v0.41.0/go.mod h1:3pfBgksrReYfZ5lvYM0kSO0LIkAl4Yl2bXOkKP7Ec2A= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM= -golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM= +golang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8= +golang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA= golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY= golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -374,21 +374,23 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b h1:+YaDE2r2OG8t/z5qmsh7Y+XXwCbvadxxZ0YY6mTdrVA= -google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f h1:gap6+3Gk41EItBuyi4XX/bp4oqJ3UwuIMl25yGinuAA= -google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:Ic02D47M+zbarjYYUlK57y316f2MoN0gjAwI3f2S95o= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f h1:OxYkA3wjPsZyBylwymxSHa7ViiW1Sml4ToBrncvFehI= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:+2Yz8+CLJbIfL9z73EW45avw8Lmge3xVElCP9zEKi50= -google.golang.org/grpc v1.69.4 h1:MF5TftSMkd8GLw/m0KM6V8CMOCY6NZ1NQDPGFgbTt4A= -google.golang.org/grpc v1.69.4/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= +google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9 h1:VPWxll4HlMw1Vs/qXtN7BvhZqsS9cdAittCNvVENElA= +google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9/go.mod h1:7QBABkRtR8z+TEnmXTqIqwJLlzrZKVfAUm7tY3yGv0M= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 h1:m8qni9SQFH0tJc1X0vmnpw/0t+AImlSvp30sEupozUg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= +google.golang.org/grpc v1.80.0 h1:Xr6m2WmWZLETvUNvIUmeD5OAagMw3FiKmMlTdViWsHM= +google.golang.org/grpc v1.80.0/go.mod h1:ho/dLnxwi3EDJA4Zghp7k2Ec1+c2jqup0bFkw07bwF4= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.36.3 h1:82DV7MYdb8anAVi3qge1wSnMDrnKK7ebr+I0hHRN1BU= -google.golang.org/protobuf v1.36.3/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 5b455109d5..b75d6a813f 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -2212,7 +2212,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { } if ctx.String(GCModeFlag.Name) == "archive" { - if cfg.TransactionHistory != 0 { + if cfg.TransactionHistory == ethconfig.Defaults.TransactionHistory { cfg.TransactionHistory = 0 log.Warn("Disabled transaction unindexing for archive node") } diff --git a/consensus/consensus.go b/consensus/consensus.go index be924ffeca..f90f708a55 100644 --- a/consensus/consensus.go +++ b/consensus/consensus.go @@ -62,9 +62,6 @@ type ChainHeaderReader interface { // GetVerifiedBlockByHash retrieves the highest verified block. GetVerifiedBlockByHash(hash common.Hash) *types.Header - - // ChasingHead return the best chain head of peers. - ChasingHead() *types.Header } type VotePool interface { diff --git a/consensus/parlia/finality_test.go b/consensus/parlia/finality_test.go index 495f6d4802..bf80d607cd 100644 --- a/consensus/parlia/finality_test.go +++ b/consensus/parlia/finality_test.go @@ -73,10 +73,6 @@ func (c *finalizedHeaderChain) GetVerifiedBlockByHash(hash common.Hash) *types.H return c.byHash[hash] } -func (c *finalizedHeaderChain) ChasingHead() *types.Header { - return c.current -} - type fixedVotePool struct { n int } diff --git a/consensus/parlia/parlia.go b/consensus/parlia/parlia.go index 5c1288fe47..3127eb16fb 100644 --- a/consensus/parlia/parlia.go +++ b/consensus/parlia/parlia.go @@ -15,10 +15,10 @@ import ( "sync" "time" + "github.com/bits-and-blooms/bitset" "github.com/ethereum/go-ethereum/common/lru" "github.com/holiman/uint256" "github.com/prysmaticlabs/prysm/v5/crypto/bls" - "github.com/willf/bitset" "golang.org/x/crypto/sha3" "github.com/ethereum/go-ethereum/accounts" diff --git a/consensus/parlia/snapshot.go b/consensus/parlia/snapshot.go index 047ddf4754..75b2e25ab3 100644 --- a/consensus/parlia/snapshot.go +++ b/consensus/parlia/snapshot.go @@ -25,6 +25,7 @@ import ( "math" "sort" + "github.com/bits-and-blooms/bitset" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/lru" "github.com/ethereum/go-ethereum/consensus" @@ -33,7 +34,6 @@ import ( "github.com/ethereum/go-ethereum/internal/ethapi" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" - "github.com/willf/bitset" ) // Snapshot is the state of the validatorSet at a given point. diff --git a/core/blockchain.go b/core/blockchain.go index 3367283add..a2f519d0d0 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -386,7 +386,6 @@ type BlockChain struct { currentSnapBlock atomic.Pointer[types.Header] // Current head of snap-sync currentFinalBlock atomic.Pointer[types.Header] // Latest (consensus) finalized block highestNotifiedFinal atomic.Pointer[types.Header] // Highest finalized block that has been notified (for deduplication) - chasingHead atomic.Pointer[types.Header] historyPrunePoint atomic.Pointer[history.PrunePoint] bodyCache *lru.Cache[common.Hash, *types.Body] @@ -521,7 +520,6 @@ func NewBlockChain(db ethdb.Database, genesis *Genesis, engine consensus.Engine, bc.highestVerifiedBlock.Store(nil) bc.currentBlock.Store(nil) bc.currentSnapBlock.Store(nil) - bc.chasingHead.Store(nil) // Update chain info data metrics chainInfoGauge.Update(metrics.GaugeInfoValue{"chain_id": bc.chainConfig.ChainID.String()}) @@ -1394,20 +1392,6 @@ func (bc *BlockChain) SnapSyncCommitHead(hash common.Hash) error { return nil } -// UpdateChasingHead update remote best chain head, used by DA check now. -func (bc *BlockChain) UpdateChasingHead(head *types.Header) { - if head.Time > uint64(time.Now().Unix()) { - log.Warn("Ignoring future chasing head", "number", head.Number, "time", head.Time) - return - } - bc.chasingHead.Store(types.CopyHeader(head)) -} - -// ChasingHead return the best chain head of peers. -func (bc *BlockChain) ChasingHead() *types.Header { - return bc.chasingHead.Load() -} - // Reset purges the entire blockchain, restoring it to its genesis state. func (bc *BlockChain) Reset() error { return bc.ResetWithGenesisBlock(bc.genesisBlock) diff --git a/core/chain_makers.go b/core/chain_makers.go index 3acd63a5cc..a0ed00ce53 100644 --- a/core/chain_makers.go +++ b/core/chain_makers.go @@ -796,7 +796,3 @@ func (cm *chainMaker) GetHighestVerifiedHeader() *types.Header { func (cm *chainMaker) GetVerifiedBlockByHash(hash common.Hash) *types.Header { return cm.GetHeaderByHash(hash) } - -func (cm *chainMaker) ChasingHead() *types.Header { - panic("not supported") -} diff --git a/core/data_availability.go b/core/data_availability.go index 8bbd235d8e..fa7cf25ea7 100644 --- a/core/data_availability.go +++ b/core/data_availability.go @@ -66,18 +66,8 @@ func IsDataAvailable(chain consensus.ChainHeaderReader, block *types.Block) (err return nil } - // Only trusted heads may decide whether recent blob data can be discarded. - // ChasingHead is populated from remote peer sync state, so future values must - // never be allowed to suppress DA checks. - highest := chain.ChasingHead() - current := chain.CurrentHeader() now := uint64(time.Now().Unix()) - if highest == nil || highest.Number == nil || highest.Time > now { - highest = current - } else if current != nil && current.Number != nil && highest.Number.Cmp(current.Number) < 0 { - highest = current - } - if block.Time()+params.MinTimeDurationForBlobRequests < highest.Time { + if block.Time()+params.MinTimeDurationForBlobRequests < now { // if we needn't check DA of this block, just clean it block.CleanSidecars() return nil diff --git a/core/data_availability_test.go b/core/data_availability_test.go index 16411049fb..bc85d64f87 100644 --- a/core/data_availability_test.go +++ b/core/data_availability_test.go @@ -24,16 +24,16 @@ var ( func TestIsDataAvailable(t *testing.T) { hr := NewMockDAHeaderReader(params.ParliaTestChainConfig) + now := uint64(time.Now().Unix()) tests := []struct { - block *types.Block - chasingHeadNumber uint64 - chasingHeadTime uint64 - withSidecar bool - err bool + block *types.Block + withSidecar bool + err bool }{ { block: types.NewBlockWithHeader(&types.Header{ Number: big.NewInt(1), + Time: now, }).WithBody(types.Body{Transactions: types.Transactions{ createMockDATx(hr.Config(), nil), createMockDATx(hr.Config(), &types.BlobTxSidecar{ @@ -42,26 +42,24 @@ func TestIsDataAvailable(t *testing.T) { Proofs: []kzg4844.Proof{emptyBlobProof}, }), }}), - chasingHeadNumber: 1, - chasingHeadTime: params.MinTimeDurationForBlobRequests - 1, - withSidecar: true, - err: false, + withSidecar: true, + err: false, }, { block: types.NewBlockWithHeader(&types.Header{ Number: big.NewInt(1), + Time: now, }).WithBody(types.Body{Transactions: types.Transactions{ createMockDATx(hr.Config(), nil), createMockDATx(hr.Config(), nil), }}), - chasingHeadNumber: 1, - chasingHeadTime: params.MinTimeDurationForBlobRequests - 1, - withSidecar: true, - err: false, + withSidecar: true, + err: false, }, { block: types.NewBlockWithHeader(&types.Header{ Number: big.NewInt(1), + Time: now, }).WithBody(types.Body{Transactions: types.Transactions{ createMockDATx(hr.Config(), nil), createMockDATx(hr.Config(), &types.BlobTxSidecar{ @@ -70,14 +68,13 @@ func TestIsDataAvailable(t *testing.T) { Proofs: []kzg4844.Proof{emptyBlobProof}, }), }}), - chasingHeadNumber: 1, - chasingHeadTime: params.MinTimeDurationForBlobRequests - 1, - withSidecar: false, - err: true, + withSidecar: false, + err: true, }, { block: types.NewBlockWithHeader(&types.Header{ Number: big.NewInt(1), + Time: now, }).WithBody(types.Body{Transactions: types.Transactions{ createMockDATx(hr.Config(), nil), createMockDATx(hr.Config(), &types.BlobTxSidecar{ @@ -91,15 +88,13 @@ func TestIsDataAvailable(t *testing.T) { Proofs: []kzg4844.Proof{emptyBlobProof, emptyBlobProof}, }), }}), - chasingHeadNumber: 1, - chasingHeadTime: params.MinTimeDurationForBlobRequests - 1, - withSidecar: true, - err: false, + withSidecar: true, + err: false, }, - { block: types.NewBlockWithHeader(&types.Header{ Number: big.NewInt(1), + Time: now, }).WithBody(types.Body{Transactions: types.Transactions{ createMockDATx(hr.Config(), nil), createMockDATx(hr.Config(), &types.BlobTxSidecar{ @@ -113,14 +108,14 @@ func TestIsDataAvailable(t *testing.T) { Proofs: []kzg4844.Proof{emptyBlobProof, emptyBlobProof, emptyBlobProof, emptyBlobProof}, }), }}), - chasingHeadNumber: params.MinBlocksForBlobRequests + 1, - chasingHeadTime: params.MinTimeDurationForBlobRequests, - withSidecar: true, - err: true, + withSidecar: true, + err: true, }, + // Old block outside the retention window: DA check is skipped, sidecars cleaned, no error. { block: types.NewBlockWithHeader(&types.Header{ Number: big.NewInt(1), + Time: 0, }).WithBody(types.Body{Transactions: types.Transactions{ createMockDATx(hr.Config(), nil), createMockDATx(hr.Config(), &types.BlobTxSidecar{ @@ -129,10 +124,8 @@ func TestIsDataAvailable(t *testing.T) { Proofs: []kzg4844.Proof{emptyBlobProof}, }), }}), - chasingHeadNumber: params.MinBlocksForBlobRequests + 1, - chasingHeadTime: params.MinTimeDurationForBlobRequests + 1, - withSidecar: false, - err: false, + withSidecar: false, + err: false, }, } @@ -140,7 +133,6 @@ func TestIsDataAvailable(t *testing.T) { if item.withSidecar { item.block = item.block.WithSidecars(collectBlobsFromTxs(item.block.Header(), item.block.Transactions())) } - hr.setChasingHead(item.chasingHeadNumber, item.chasingHeadTime) err := IsDataAvailable(hr, item.block) if item.err { require.Error(t, err, i) @@ -151,43 +143,45 @@ func TestIsDataAvailable(t *testing.T) { } } -func TestIsDataAvailableRejectsFutureChasingHead(t *testing.T) { - blockTime := uint64(time.Now().Unix()) - cfg := params.ParliaTestChainConfig - - badBlob := emptyBlob - badBlob[0] = 0x01 - badSidecar := &types.BlobTxSidecar{ - Blobs: []kzg4844.Blob{badBlob}, - Commitments: []kzg4844.Commitment{emptyBlobCommit}, - Proofs: []kzg4844.Proof{emptyBlobProof}, - } - makeBlock := func() *types.Block { - block := types.NewBlockWithHeader(&types.Header{ - Number: big.NewInt(1), - Time: blockTime, - }).WithBody(types.Body{Transactions: types.Transactions{ - createMockDATx(cfg, badSidecar), - }}) - return block.WithSidecars(collectBlobsFromTxs(block.Header(), block.Transactions())) - } +// TestIsDataAvailableSkipsOldBlocks verifies that the time-based retention window +// is enforced using wall-clock time: old blocks bypass DA and get sidecars cleaned, +// while recent blocks are always fully validated. +func TestIsDataAvailableSkipsOldBlocks(t *testing.T) { + hr := NewMockDAHeaderReader(params.ParliaTestChainConfig) - block := makeBlock() - reader := &mockSplitDAHeaderReader{ - config: cfg, - currentNum: 1, - currentTime: blockTime, - chasingNum: 100000, - chasingTime: blockTime + 30*86400, - } + // A block outside the retention window must have sidecars cleaned without error. + oldBlock := types.NewBlockWithHeader(&types.Header{ + Number: big.NewInt(1), + Time: 0, // far outside MinTimeDurationForBlobRequests window + }).WithBody(types.Body{Transactions: types.Transactions{ + createMockDATx(hr.Config(), &types.BlobTxSidecar{ + Blobs: []kzg4844.Blob{emptyBlob}, + Commitments: []kzg4844.Commitment{emptyBlobCommit}, + Proofs: []kzg4844.Proof{emptyBlobProof}, + }), + }}) + oldBlock = oldBlock.WithSidecars(collectBlobsFromTxs(oldBlock.Header(), oldBlock.Transactions())) + require.NotEmpty(t, oldBlock.Sidecars()) + require.NoError(t, IsDataAvailable(hr, oldBlock)) + require.Empty(t, oldBlock.Sidecars(), "sidecars must be cleaned for blocks outside the retention window") - err := IsDataAvailable(reader, block) - require.Error(t, err) - require.NotEmpty(t, block.Sidecars()) + // A recent block with an invalid sidecar must not be silently skipped. + recentBlock := types.NewBlockWithHeader(&types.Header{ + Number: big.NewInt(1), + Time: uint64(time.Now().Unix()), + }).WithBody(types.Body{Transactions: types.Transactions{ + createMockDATx(hr.Config(), &types.BlobTxSidecar{ + Blobs: []kzg4844.Blob{emptyBlob, emptyBlob, emptyBlob}, + Commitments: []kzg4844.Commitment{emptyBlobCommit, emptyBlobCommit, emptyBlobCommit}, + Proofs: []kzg4844.Proof{emptyBlobProof}, // mismatched proof count + }), + }}) + require.Error(t, IsDataAvailable(hr, recentBlock), "recent blocks with invalid sidecars must fail DA check") } func TestCheckDataAvailableInBatch(t *testing.T) { hr := NewMockDAHeaderReader(params.ParliaTestChainConfig) + now := uint64(time.Now().Unix()) tests := []struct { chain types.Blocks err bool @@ -197,6 +191,7 @@ func TestCheckDataAvailableInBatch(t *testing.T) { chain: types.Blocks{ types.NewBlockWithHeader(&types.Header{ Number: big.NewInt(1), + Time: now, }).WithBody(types.Body{Transactions: types.Transactions{ createMockDATx(hr.Config(), nil), createMockDATx(hr.Config(), &types.BlobTxSidecar{ @@ -212,6 +207,7 @@ func TestCheckDataAvailableInBatch(t *testing.T) { }}), types.NewBlockWithHeader(&types.Header{ Number: big.NewInt(2), + Time: now, }).WithBody(types.Body{Transactions: types.Transactions{ createMockDATx(hr.Config(), &types.BlobTxSidecar{ Blobs: []kzg4844.Blob{emptyBlob, emptyBlob}, @@ -226,6 +222,7 @@ func TestCheckDataAvailableInBatch(t *testing.T) { chain: types.Blocks{ types.NewBlockWithHeader(&types.Header{ Number: big.NewInt(1), + Time: now, }).WithBody(types.Body{Transactions: types.Transactions{ createMockDATx(hr.Config(), &types.BlobTxSidecar{ Blobs: []kzg4844.Blob{emptyBlob}, @@ -235,6 +232,7 @@ func TestCheckDataAvailableInBatch(t *testing.T) { }}), types.NewBlockWithHeader(&types.Header{ Number: big.NewInt(2), + Time: now, }).WithBody(types.Body{Transactions: types.Transactions{ createMockDATx(hr.Config(), &types.BlobTxSidecar{ Blobs: []kzg4844.Blob{emptyBlob, emptyBlob, emptyBlob}, @@ -244,6 +242,7 @@ func TestCheckDataAvailableInBatch(t *testing.T) { }}), types.NewBlockWithHeader(&types.Header{ Number: big.NewInt(3), + Time: now, }).WithBody(types.Body{Transactions: types.Transactions{ createMockDATx(hr.Config(), &types.BlobTxSidecar{ Blobs: []kzg4844.Blob{emptyBlob}, @@ -259,6 +258,7 @@ func TestCheckDataAvailableInBatch(t *testing.T) { chain: types.Blocks{ types.NewBlockWithHeader(&types.Header{ Number: big.NewInt(1), + Time: now, }).WithBody(types.Body{Transactions: types.Transactions{ createMockDATx(hr.Config(), nil), createMockDATx(hr.Config(), &types.BlobTxSidecar{ @@ -297,6 +297,7 @@ func BenchmarkEmptySidecarDAChecking(b *testing.B) { hr := NewMockDAHeaderReader(params.ParliaTestChainConfig) block := types.NewBlockWithHeader(&types.Header{ Number: big.NewInt(1), + Time: uint64(time.Now().Unix()), }).WithBody(types.Body{Transactions: types.Transactions{ createMockDATx(hr.Config(), emptySidecar()), createMockDATx(hr.Config(), emptySidecar()), @@ -319,6 +320,7 @@ func BenchmarkRandomSidecarDAChecking(b *testing.B) { for i := 0; i < len(blocks); i++ { block := types.NewBlockWithHeader(&types.Header{ Number: big.NewInt(1), + Time: uint64(time.Now().Unix()), }).WithBody(types.Body{Transactions: types.Transactions{ createMockDATx(hr.Config(), randomSidecar()), createMockDATx(hr.Config(), randomSidecar()), @@ -353,28 +355,11 @@ func collectBlobsFromTxs(header *types.Header, txs types.Transactions) types.Blo } type mockDAHeaderReader struct { - config *params.ChainConfig - chasingHeadNumber uint64 - chasingHeadTime uint64 -} - -type mockSplitDAHeaderReader struct { - config *params.ChainConfig - currentNum uint64 - currentTime uint64 - chasingNum uint64 - chasingTime uint64 + config *params.ChainConfig } func NewMockDAHeaderReader(config *params.ChainConfig) *mockDAHeaderReader { - return &mockDAHeaderReader{ - config: config, - } -} - -func (r *mockDAHeaderReader) setChasingHead(number, time uint64) { - r.chasingHeadNumber = number - r.chasingHeadTime = time + return &mockDAHeaderReader{config: config} } func (r *mockDAHeaderReader) Config() *params.ChainConfig { @@ -382,17 +367,7 @@ func (r *mockDAHeaderReader) Config() *params.ChainConfig { } func (r *mockDAHeaderReader) CurrentHeader() *types.Header { - return &types.Header{ - Number: new(big.Int).SetUint64(r.chasingHeadNumber), - Time: r.chasingHeadTime, - } -} - -func (r *mockDAHeaderReader) ChasingHead() *types.Header { - return &types.Header{ - Number: new(big.Int).SetUint64(r.chasingHeadNumber), - Time: r.chasingHeadTime, - } + return &types.Header{} } func (r *mockDAHeaderReader) GenesisHeader() *types.Header { @@ -423,81 +398,6 @@ func (r *mockDAHeaderReader) GetVerifiedBlockByHash(hash common.Hash) *types.Hea panic("not supported") } -func (r *mockSplitDAHeaderReader) Config() *params.ChainConfig { - return r.config -} - -func (r *mockSplitDAHeaderReader) CurrentHeader() *types.Header { - return &types.Header{ - Number: new(big.Int).SetUint64(r.currentNum), - Time: r.currentTime, - } -} - -func (r *mockSplitDAHeaderReader) ChasingHead() *types.Header { - if r.chasingNum == 0 && r.chasingTime == 0 { - return nil - } - return &types.Header{ - Number: new(big.Int).SetUint64(r.chasingNum), - Time: r.chasingTime, - } -} - -func (r *mockSplitDAHeaderReader) GenesisHeader() *types.Header { - panic("not supported") -} - -func (r *mockSplitDAHeaderReader) GetHeader(hash common.Hash, number uint64) *types.Header { - panic("not supported") -} - -func (r *mockSplitDAHeaderReader) GetHeaderByNumber(number uint64) *types.Header { - panic("not supported") -} - -func (r *mockSplitDAHeaderReader) GetHeaderByHash(hash common.Hash) *types.Header { - panic("not supported") -} - -func (r *mockSplitDAHeaderReader) GetTd(hash common.Hash, number uint64) *big.Int { - panic("not supported") -} - -func (r *mockSplitDAHeaderReader) GetHighestVerifiedHeader() *types.Header { - panic("not supported") -} - -func (r *mockSplitDAHeaderReader) GetVerifiedBlockByHash(hash common.Hash) *types.Header { - panic("not supported") -} - -func TestUpdateChasingHeadRejectsFutureHeader(t *testing.T) { - now := uint64(time.Now().Unix()) - bc := &BlockChain{hc: &HeaderChain{}} - bc.hc.SetCurrentHeader(&types.Header{ - Number: big.NewInt(100), - Time: now, - }) - - valid := &types.Header{ - Number: big.NewInt(101), - Time: now, - } - bc.UpdateChasingHead(valid) - require.NotNil(t, bc.ChasingHead()) - require.Equal(t, valid.Number.Uint64(), bc.ChasingHead().Number.Uint64()) - require.Equal(t, valid.Time, bc.ChasingHead().Time) - - future := &types.Header{ - Number: big.NewInt(102), - Time: now + uint64(time.Hour/time.Second), - } - bc.UpdateChasingHead(future) - require.Equal(t, valid.Number.Uint64(), bc.ChasingHead().Number.Uint64()) - require.Equal(t, valid.Time, bc.ChasingHead().Time) -} - func createMockDATx(config *params.ChainConfig, sidecar *types.BlobTxSidecar) *types.Transaction { if sidecar == nil { tx := &types.DynamicFeeTx{ diff --git a/core/headerchain.go b/core/headerchain.go index 5dfb5eef05..05897a45fe 100644 --- a/core/headerchain.go +++ b/core/headerchain.go @@ -426,10 +426,6 @@ func (hc *HeaderChain) GetVerifiedBlockByHash(hash common.Hash) *types.Header { return hc.GetHeaderByHash(hash) } -func (hc *HeaderChain) ChasingHead() *types.Header { - return nil -} - // GetAncestor retrieves the Nth ancestor of a given block. It assumes that either the given block or // a close ancestor of it is canonical. maxNonCanonical points to a downwards counter limiting the // number of blocks to be individually checked before we reach the canonical chain. diff --git a/core/rawdb/chain_freezer.go b/core/rawdb/chain_freezer.go index b2e65db2a5..9f20ae80c1 100644 --- a/core/rawdb/chain_freezer.go +++ b/core/rawdb/chain_freezer.go @@ -40,9 +40,9 @@ const ( // storage. freezerRecheckInterval = time.Minute - // TODO(galaio): For BSC, the 0.75 interval and freezing of 30,000 blocks will seriously affect performance. - // It is temporarily adjusted to 100, and improves the freezing performance later. - SlowFreezerBatchLimit = 100 + // For BSC, freezing 30,000 blocks at once will seriously affect performance near the chain head. + // Set to 200 to keep up with 450ms block interval (~133 blocks/min) while limiting I/O impact. + SlowFreezerBatchLimit = 200 SlowdownFreezeWindow = 24 * time.Hour ) diff --git a/core/txpool/validation_test.go b/core/txpool/validation_test.go index 3945b548c1..4e2b30784f 100644 --- a/core/txpool/validation_test.go +++ b/core/txpool/validation_test.go @@ -18,16 +18,21 @@ package txpool import ( "crypto/ecdsa" + "crypto/rand" "errors" "math" "math/big" "testing" + "github.com/consensys/gnark-crypto/ecc/bls12-381/fr" + gokzg4844 "github.com/crate-crypto/go-eth-kzg" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/crypto/kzg4844" "github.com/ethereum/go-ethereum/params" + "github.com/holiman/uint256" ) func TestValidateTransactionEIP2681(t *testing.T) { @@ -113,3 +118,67 @@ func createTestTransaction(key *ecdsa.PrivateKey, nonce uint64) *types.Transacti signedTx, _ := types.SignTx(tx, types.HomesteadSigner{}, key) return signedTx } + +func randFieldElement() [32]byte { + bytes := make([]byte, 32) + _, err := rand.Read(bytes) + if err != nil { + panic("failed to get random field element") + } + var r fr.Element + r.SetBytes(bytes) + return gokzg4844.SerializeScalar(r) +} + +func randBlob() kzg4844.Blob { + var blob kzg4844.Blob + for i := 0; i < len(blob); i += gokzg4844.SerializedScalarSize { + fieldElementBytes := randFieldElement() + copy(blob[i:i+gokzg4844.SerializedScalarSize], fieldElementBytes[:]) + } + return blob +} + +func validBlobSidecar(n int) *types.BlobTxSidecar { + blobs := make([]kzg4844.Blob, n) + commitments := make([]kzg4844.Commitment, n) + proofs := make([]kzg4844.Proof, n) + for i := 0; i < n; i++ { + blobs[i] = randBlob() + c, _ := kzg4844.BlobToCommitment(&blobs[i]) + commitments[i] = c + p, _ := kzg4844.ComputeBlobProof(&blobs[i], c) + proofs[i] = p + } + return types.NewBlobTxSidecar(types.BlobSidecarVersion0, blobs, commitments, proofs) +} + +func signedBlobTx(key *ecdsa.PrivateKey, nonce uint64, sidecar *types.BlobTxSidecar, blobFeeCap uint64) *types.Transaction { + blobtx := &types.BlobTx{ + ChainID: uint256.MustFromBig(params.MainnetChainConfig.ChainID), + Nonce: nonce, + GasTipCap: uint256.NewInt(1), + GasFeeCap: uint256.NewInt(1000), + Gas: 21000, + BlobFeeCap: uint256.NewInt(blobFeeCap), + BlobHashes: sidecar.BlobHashes(), + Value: uint256.NewInt(0), + Sidecar: sidecar, + } + tx := types.NewTx(blobtx) + signed, _ := types.SignTx(tx, types.NewCancunSigner(params.MainnetChainConfig.ChainID), key) + return signed +} + +// TestValidateBlobTx_InvalidProof verifies that ValidateBlobTx rejects a +// transaction with a tampered KZG proof. +func TestValidateBlobTx_InvalidProof(t *testing.T) { + key, _ := crypto.GenerateKey() + sidecar := validBlobSidecar(1) + sidecar.Proofs[0][0] ^= 0xff + tx := signedBlobTx(key, 0, sidecar, 1) + + if err := ValidateBlobTx(tx, nil, nil); err == nil { + t.Fatal("ValidateBlobTx should fail with tampered proof") + } +} diff --git a/core/types/bid.go b/core/types/bid.go index 403f5de1e5..4f7d52f7d5 100644 --- a/core/types/bid.go +++ b/core/types/bid.go @@ -175,6 +175,10 @@ type Bid struct { committed bool // whether the bid has been committed to simulate or not rawBid RawBid + + // BlobValResults carries per-tx results of async blob validation (field + // checks + KZG proof verification), keyed by transaction hash. + BlobValResults map[common.Hash]chan error } func (b *Bid) Commit() { diff --git a/core/vm/contracts_lightclient.go b/core/vm/contracts_lightclient.go index 62ddf0c465..d83c537644 100644 --- a/core/vm/contracts_lightclient.go +++ b/core/vm/contracts_lightclient.go @@ -7,7 +7,7 @@ import ( "net/url" "strings" - "github.com/tendermint/iavl" + "github.com/cosmos/iavl" "github.com/tendermint/tendermint/crypto/merkle" "github.com/tendermint/tendermint/crypto/secp256k1" cmn "github.com/tendermint/tendermint/libs/common" diff --git a/core/vm/contracts_lightclient_test.go b/core/vm/contracts_lightclient_test.go index e669fbaea7..e3211b07da 100644 --- a/core/vm/contracts_lightclient_test.go +++ b/core/vm/contracts_lightclient_test.go @@ -5,9 +5,9 @@ import ( "encoding/hex" "testing" + "github.com/cosmos/iavl" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/tendermint/iavl" "github.com/tendermint/tendermint/crypto/merkle" cmn "github.com/tendermint/tendermint/libs/common" diff --git a/core/vm/instructions.go b/core/vm/instructions.go index 9c94ddf6b2..baa96ef876 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -1497,11 +1497,13 @@ func opSwap1Push1Dup1NotSwap2AddAndDup2AddSwap1Dup2LT(pc *uint64, interpreter *E e := scope.Stack.Back(1) c.Add(e, c) scope.Stack.swap1() - g, h := *c, scope.Stack.peek() - if g.Lt(h) { - h.SetOne() + // Match the raw DUP2, LT sequence: compare the computed value now at + // stack[len-2] against the original top value at stack[len-1]. + computed, original := *scope.Stack.Back(1), scope.Stack.peek() + if computed.Lt(original) { + original.SetOne() } else { - h.Clear() + original.Clear() } *pc += 10 diff --git a/core/vm/instructions_test.go b/core/vm/instructions_test.go index 9a2998c168..c2406e17e2 100644 --- a/core/vm/instructions_test.go +++ b/core/vm/instructions_test.go @@ -1415,6 +1415,83 @@ func TestOpSwap1Push1Dup1NotSwap2AddAndDup2AddSwap1Dup2LT(t *testing.T) { require.Equal(t, scope2.Memory.Data(), scope1.Memory.Data()) } +func TestOpSwap1Push1Dup1NotSwap2AddAndDup2AddSwap1Dup2LTOverflow(t *testing.T) { + var err error + code := []byte{0x90, 0x60, 0x0, 0x80, 0x19, 0x91, 0x1, 0x16, 0x81, 0x1, 0x90, 0x81, 0x10} + maxMinus10 := new(uint256.Int).SetAllOne() + maxMinus10.Sub(maxMinus10, uint256.NewInt(10)) + + pc1 := uint64(0) + stack1 := new(Stack) + stack1.push(maxMinus10.Clone()) + stack1.push(uint256.NewInt(100)) + scope1 := &ScopeContext{ + Contract: &Contract{Code: code, optimized: true}, + Stack: stack1, + Memory: NewMemory(), + } + scope1.Memory.Resize(34) + interpreter1 := &EVMInterpreter{} + + _, err = opSwap1Push1Dup1NotSwap2AddAndDup2AddSwap1Dup2LT(&pc1, interpreter1, scope1) + require.NoError(t, err) + + pc2 := uint64(0) + stack2 := new(Stack) + stack2.push(maxMinus10.Clone()) + stack2.push(uint256.NewInt(100)) + scope2 := &ScopeContext{ + Contract: &Contract{Code: code}, + Stack: stack2, + Memory: NewMemory(), + } + scope2.Memory.Resize(34) + interpreter2 := &EVMInterpreter{} + + _, err = opSwap1(&pc2, interpreter2, scope2) + require.NoError(t, err) + pc2++ + _, err = opPush1(&pc2, interpreter2, scope2) + require.NoError(t, err) + pc2++ + _, err = makeDup(1)(&pc2, interpreter2, scope2) + require.NoError(t, err) + pc2++ + _, err = opNot(&pc2, interpreter2, scope2) + require.NoError(t, err) + pc2++ + _, err = opSwap2(&pc2, interpreter2, scope2) + require.NoError(t, err) + pc2++ + _, err = opAdd(&pc2, interpreter2, scope2) + require.NoError(t, err) + pc2++ + _, err = opAnd(&pc2, interpreter2, scope2) + require.NoError(t, err) + pc2++ + _, err = makeDup(2)(&pc2, interpreter2, scope2) + require.NoError(t, err) + pc2++ + _, err = opAdd(&pc2, interpreter2, scope2) + require.NoError(t, err) + pc2++ + _, err = opSwap1(&pc2, interpreter2, scope2) + require.NoError(t, err) + pc2++ + _, err = makeDup(2)(&pc2, interpreter2, scope2) + require.NoError(t, err) + pc2++ + _, err = opLt(&pc2, interpreter2, scope2) + require.NoError(t, err) + + require.Equal(t, stack1.len(), stack2.len()) + for stack1.len() != 0 { + require.Equal(t, stack1.pop(), stack2.pop()) + } + require.Equal(t, pc1, pc2) + require.Equal(t, scope2.Memory.Data(), scope1.Memory.Data()) +} + func TestOpPush1CalldataloadPush1ShrDup1Push4GtPush2(t *testing.T) { var err error code := []byte{0x60, 0x10, 0x35, 0x60, 0x11, 0x1c, 0x80, 0x63, 0x12, 0x13, 0x14, 0x15, 0x11, 0x61, 0x16, 0x17} diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go index 5bef1d166e..27cbb46c03 100644 --- a/core/vm/interpreter.go +++ b/core/vm/interpreter.go @@ -211,6 +211,7 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) ( res []byte // result of the opcode execution function debug = in.evm.Config.Tracer != nil isEIP4762 = in.evm.chainRules.IsEIP4762 + fallback []OpCode ) // Don't move this deferred function, it's placed before the OnOpcode-deferred method, // so that it gets executed _after_: the OnOpcode needs the stacks before @@ -258,7 +259,11 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) ( // Get the operation from the jump table and validate the stack to ensure there are // enough stack items available to perform the operation. - op = contract.GetOp(pc) + if len(fallback) > 0 { + op = fallback[0] + } else { + op = contract.GetOp(pc) + } operation := jumpTable[op] cost = operation.constantGas // For tracing // Validate stack @@ -269,9 +274,11 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) ( } // for tracing: this gas consumption event is emitted below in the debug section. if contract.Gas < cost { - if seq, isSuper := DecomposeSuperInstruction(op); isSuper { - err = in.tryFallbackForSuperInstruction(&pc, seq, contract, stack, mem, callContext) - return nil, err + if len(fallback) == 0 { + if seq, isSuper := DecomposeSuperInstruction(op); isSuper { + fallback = seq + continue + } } return nil, ErrOutOfGas } else { @@ -310,9 +317,11 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) ( if contract.Gas < dynamicCost { contract.Gas += operation.constantGas // restore deducted constant gas first mem.lastGasCost = memLastGasCost - if seq, isSuper := DecomposeSuperInstruction(op); isSuper { - err = in.tryFallbackForSuperInstruction(&pc, seq, contract, stack, mem, callContext) - return nil, err + if len(fallback) == 0 { + if seq, isSuper := DecomposeSuperInstruction(op); isSuper { + fallback = seq + continue + } } return nil, ErrOutOfGas } else { @@ -340,6 +349,9 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) ( break } pc++ + if len(fallback) > 0 { + fallback = fallback[1:] + } } if err == errStopToken { diff --git a/core/vm/interpreter_si.go b/core/vm/interpreter_si.go index 747bf02dc8..fc9df611fd 100644 --- a/core/vm/interpreter_si.go +++ b/core/vm/interpreter_si.go @@ -1,12 +1,6 @@ package vm -import ( - "fmt" - "strings" - - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/log" -) +import "strings" // superInstructionMap maps super-instruction opcodes to the slice of ordinary opcodes // they were fused from. The mapping comes from the fusion patterns implemented in @@ -60,59 +54,3 @@ func DecomposeSuperInstructionByName(name string) ([]OpCode, bool) { op := StringToOp(strings.ToUpper(name)) return DecomposeSuperInstruction(op) } - -func (in *EVMInterpreter) executeSingleOpcode(pc *uint64, op OpCode, contract *Contract, stack *Stack, mem *Memory, callCtx *ScopeContext) error { - operation := in.table[op] - if operation == nil { - return fmt.Errorf("unknown opcode %02x", op) - } - - // -------- check static gas -------- - if contract.Gas < operation.constantGas { - return ErrOutOfGas - } - contract.Gas -= operation.constantGas - - // -------- check dynamic gas -------- - var memorySize uint64 - if operation.memorySize != nil { - memSize, overflow := operation.memorySize(stack) - if overflow { - return ErrGasUintOverflow - } - if memorySize, overflow = math.SafeMul(toWordSize(memSize), 32); overflow { - return ErrGasUintOverflow - } - } - - if operation.dynamicGas != nil { - dyn, err := operation.dynamicGas(in.evm, contract, stack, mem, memorySize) - if err != nil { - return err - } - if contract.Gas < dyn { - return ErrOutOfGas - } - contract.Gas -= dyn - } - - if memorySize > 0 { - mem.Resize(memorySize) - } - - // -------- execute -------- - _, err := operation.execute(pc, in, callCtx) - return err -} - -// tryFallbackForSuperInstruction break down superinstruction to normal opcode and execute in sequence, until gas deplete or succeed -// return nil show successful execution of si or OOG in the middle (and updated pc/gas), shall continue in main loop -func (in *EVMInterpreter) tryFallbackForSuperInstruction(pc *uint64, seq []OpCode, contract *Contract, stack *Stack, mem *Memory, callCtx *ScopeContext) error { - for _, sub := range seq { - if err := in.executeSingleOpcode(pc, sub, contract, stack, mem, callCtx); err != nil { - log.Debug("[FALLBACK-EXEC]", "op", sub.String(), "err", err, "gasLeft", contract.Gas) - return err // OutOfGas or other errors, will let upper level handle - } - } - return nil -} diff --git a/core/vm/interpreter_test.go b/core/vm/interpreter_test.go index 8a52987b6b..7af45e7533 100644 --- a/core/vm/interpreter_test.go +++ b/core/vm/interpreter_test.go @@ -28,6 +28,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/params" "github.com/holiman/uint256" + "github.com/stretchr/testify/require" ) var loopInterruptTests = []string{ @@ -94,3 +95,88 @@ func BenchmarkInterpreter(b *testing.B) { gasSStoreEIP3529(evm, contract, stack, mem, 1234) } } + +func TestSuperInstructionFallbackContinuesExecution(t *testing.T) { + statedb, _ := state.New(types.EmptyRootHash, state.NewDatabaseForTesting()) + evm := NewEVM(BlockContext{BlockNumber: big.NewInt(1), Time: 1, Random: &common.Hash{}}, statedb, params.MergedTestChainConfig, Config{}) + interpreter := NewEVMInterpreter(evm) + interpreter.CopyAndInstallSuperInstruction() + interpreter.table[Push1Push1].constantGas = 10_000 + + contract := GetContract(common.Address{}, common.Address{}, uint256.NewInt(0), 100, nil) + contract.Code = []byte{ + byte(Push1Push1), 0x01, byte(Nop), 0x02, + byte(ADD), + byte(PUSH1), 0x00, + byte(MSTORE), + byte(PUSH1), 0x20, + byte(PUSH1), 0x00, + byte(RETURN), + } + contract.SetOptimizedForTest() + + ret, err := interpreter.Run(contract, nil, false) + require.NoError(t, err) + require.Equal(t, common.LeftPadBytes([]byte{0x03}, 32), ret) +} + +func TestSuperInstructionFallbackContinuesTracing(t *testing.T) { + statedb, _ := state.New(types.EmptyRootHash, state.NewDatabaseForTesting()) + var traced []OpCode + evm := NewEVM(BlockContext{BlockNumber: big.NewInt(1), Time: 1, Random: &common.Hash{}}, statedb, params.MergedTestChainConfig, Config{ + Tracer: &tracing.Hooks{ + OnOpcode: func(pc uint64, op byte, gas, cost uint64, scope tracing.OpContext, rData []byte, depth int, err error) { + traced = append(traced, OpCode(op)) + }, + }, + }) + interpreter := NewEVMInterpreter(evm) + interpreter.CopyAndInstallSuperInstruction() + interpreter.table[Push1Push1].constantGas = 10_000 + + contract := GetContract(common.Address{}, common.Address{}, uint256.NewInt(0), 100, nil) + contract.Code = []byte{byte(Push1Push1), 0x01, byte(Nop), 0x02, byte(STOP)} + contract.SetOptimizedForTest() + + _, err := interpreter.Run(contract, nil, false) + require.NoError(t, err) + require.Equal(t, []OpCode{PUSH1, PUSH1, STOP}, traced) +} + +func TestSuperInstructionFallbackChargesVerkleCodeChunks(t *testing.T) { + statedb, _ := state.New(types.EmptyRootHash, state.NewDatabaseForTesting()) + chainConfig := *params.MergedTestChainConfig + chainConfig.PragueTime = nil + chainConfig.OsakaTime = nil + verkleTime := uint64(0) + chainConfig.VerkleTime = &verkleTime + + evm := NewEVM(BlockContext{BlockNumber: big.NewInt(1), Time: 1, Random: &common.Hash{}}, statedb, &chainConfig, Config{}) + evm.SetTxContext(TxContext{}) + + interpreter := NewEVMInterpreter(evm) + interpreter.CopyAndInstallSuperInstruction() + interpreter.table[Push2Jump].constantGas = 10_000 + + code := make([]byte, 33) + code[0] = byte(JUMPDEST) + code[1] = byte(PUSH1) + code[2] = 0x1b + code[3] = byte(JUMP) + code[4] = byte(JUMPDEST) + code[5] = byte(STOP) + code[27] = byte(JUMPDEST) + code[28] = byte(Push2Jump) + code[29] = 0x00 + code[30] = 0x04 + code[31] = byte(Nop) + code[32] = byte(STOP) + + contract := GetContract(common.Address{}, common.Address{}, uint256.NewInt(0), 5_000, nil) + contract.Code = code + contract.SetOptimizedForTest() + + _, err := interpreter.Run(contract, nil, false) + require.NoError(t, err) + require.Len(t, evm.TxContext.AccessEvents.Keys(), 2) +} diff --git a/core/vm/lightclient/v1/multistoreproof.go b/core/vm/lightclient/v1/multistoreproof.go index 742e8bcdb7..cec65041b7 100644 --- a/core/vm/lightclient/v1/multistoreproof.go +++ b/core/vm/lightclient/v1/multistoreproof.go @@ -4,7 +4,7 @@ import ( "bytes" "fmt" - "github.com/tendermint/iavl" + "github.com/cosmos/iavl" "github.com/tendermint/tendermint/crypto/merkle" cmn "github.com/tendermint/tendermint/libs/common" ) diff --git a/core/vote/vote_pool.go b/core/vote/vote_pool.go index 462346e388..6ad995d6f1 100644 --- a/core/vote/vote_pool.go +++ b/core/vote/vote_pool.go @@ -78,6 +78,7 @@ type VotePool struct { highestVerifiedBlockSub event.Subscription votesCh chan *types.VoteEnvelope + quit chan struct{} engine consensus.PoSA } @@ -94,6 +95,7 @@ func NewVotePool(chain *core.BlockChain, engine consensus.PoSA) *VotePool { futureVotesPq: &votesPriorityQueue{}, highestVerifiedBlockCh: make(chan core.HighestVerifiedBlockEvent, highestVerifiedBlockChanSize), votesCh: make(chan *types.VoteEnvelope, voteBufferForPut), + quit: make(chan struct{}), engine: engine, } @@ -110,6 +112,8 @@ func (pool *VotePool) loop() { for { select { + case <-pool.quit: + return // Handle ChainHeadEvent. case ev := <-pool.highestVerifiedBlockCh: if ev.Header != nil { @@ -128,7 +132,11 @@ func (pool *VotePool) loop() { } func (pool *VotePool) PutVote(vote *types.VoteEnvelope) { - pool.votesCh <- vote + select { + case pool.votesCh <- vote: + default: + log.Warn("VotePool channel full, vote dropped", "hash", vote.Hash()) + } } func (pool *VotePool) putIntoVotePool(vote *types.VoteEnvelope) bool { @@ -399,6 +407,11 @@ func (pool *VotePool) basicVerify(vote *types.VoteEnvelope, headNumber uint64, m return true } +func (pool *VotePool) Stop() { + close(pool.quit) + pool.scope.Close() +} + func (pq votesPriorityQueue) Less(i, j int) bool { return pq[i].TargetNumber < pq[j].TargetNumber } diff --git a/eth/backend.go b/eth/backend.go index 6650d1f238..b50d3f61fd 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -1016,6 +1016,9 @@ func (s *Ethereum) Stop() error { if s.miner.Mining() { s.miner.TryWaitProposalDoneWhenStopping() } + if s.votePool != nil { + s.votePool.Stop() + } // Stop all the peer-related stuff first. s.discmix.Close() s.dropper.Stop() diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go index da636e88b5..ddcba60f1b 100644 --- a/eth/downloader/downloader.go +++ b/eth/downloader/downloader.go @@ -226,9 +226,6 @@ type BlockChain interface { // with trie nodes. TrieDB() *triedb.Database - // UpdateChasingHead update remote best chain head, used by DA check now. - UpdateChasingHead(head *types.Header) - // AncientTail retrieves the tail the ancients blocks AncientTail() (uint64, error) @@ -648,8 +645,6 @@ func (d *Downloader) syncWithPeer(p *peerConnection, hash common.Hash, td, ttd * return d.checkStalling(td, beaconMode) }) } - // update the chasing head - d.blockchain.UpdateChasingHead(remoteHeader) return d.spawnSync(fetchers) } diff --git a/eth/ethconfig/config.go b/eth/ethconfig/config.go index a2f8604dde..c34ec2315c 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -58,6 +58,7 @@ var Defaults = Config{ NetworkId: 0, // enable auto configuration of networkID == chainID TxLookupLimit: 2350000, TransactionHistory: 2350000, + LogHistory: 576000, BlockHistory: 0, StateHistory: params.FullImmutabilityThreshold, DatabaseCache: 512, diff --git a/eth/fetcher/block_fetcher.go b/eth/fetcher/block_fetcher.go index a4726974de..f157250b1c 100644 --- a/eth/fetcher/block_fetcher.go +++ b/eth/fetcher/block_fetcher.go @@ -34,10 +34,10 @@ import ( const ( lightTimeout = time.Millisecond // Time allowance before an announced header is explicitly requested - arriveTimeout = 500 * time.Millisecond // Time allowance before an announced block/transaction is explicitly requested - gatherSlack = 100 * time.Millisecond // Interval used to collate almost-expired announces with fetches + arriveTimeout = 200 * time.Millisecond // Time allowance before an announced block/transaction is explicitly requested + gatherSlack = 50 * time.Millisecond // Interval used to collate almost-expired announces with fetches fetchTimeout = 5 * time.Second // Maximum allotted time to return an explicitly requested block/transaction - reQueueBlockTimeout = 500 * time.Millisecond // Time allowance before blocks are requeued for import + reQueueBlockTimeout = 200 * time.Millisecond // Time allowance before blocks are requeued for import ) diff --git a/eth/fetcher/tx_fetcher.go b/eth/fetcher/tx_fetcher.go index ea51fe40b1..1794175926 100644 --- a/eth/fetcher/tx_fetcher.go +++ b/eth/fetcher/tx_fetcher.go @@ -64,11 +64,11 @@ const ( // txArriveTimeout is the time allowance before an announced transaction is // explicitly requested. - txArriveTimeout = 500 * time.Millisecond + txArriveTimeout = 200 * time.Millisecond // txGatherSlack is the interval used to collate almost-expired announces // with network fetches. - txGatherSlack = 100 * time.Millisecond + txGatherSlack = 50 * time.Millisecond // addTxsBatchSize it the max number of transactions to add in a single batch from a peer. addTxsBatchSize = 128 diff --git a/eth/protocols/eth/peer.go b/eth/protocols/eth/peer.go index 5dc78f1ec0..b70806b0de 100644 --- a/eth/protocols/eth/peer.go +++ b/eth/protocols/eth/peer.go @@ -51,14 +51,13 @@ const ( maxQueuedTxAnns = 4096 // maxQueuedBlocks is the maximum number of block propagations to queue up before - // dropping broadcasts. There's not much point in queueing stale blocks, so a few - // that might cover uncles should be enough. - maxQueuedBlocks = 4 + // dropping broadcasts. With 450ms block interval, a 1.5s slow block can cause 3-4 + // blocks to queue up, so we need a larger buffer to avoid dropping broadcasts. + maxQueuedBlocks = 16 // maxQueuedBlockAnns is the maximum number of block announcements to queue up before - // dropping broadcasts. Similarly to block propagations, there's no point to queue - // above some healthy uncle limit, so use that. - maxQueuedBlockAnns = 4 + // dropping broadcasts. Increased to match maxQueuedBlocks for 450ms block interval. + maxQueuedBlockAnns = 16 ) // Peer is a collection of relevant information we have about a `eth` peer. diff --git a/go.mod b/go.mod index 46fbfe05e2..d39346b320 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/ethereum/go-ethereum -go 1.24.0 +go 1.25.0 require ( github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.0 @@ -10,6 +10,7 @@ require ( github.com/aws/aws-sdk-go-v2/config v1.18.45 github.com/aws/aws-sdk-go-v2/credentials v1.13.43 github.com/aws/aws-sdk-go-v2/service/route53 v1.30.2 + github.com/bits-and-blooms/bitset v1.20.0 github.com/bnb-chain/fastssz v0.1.2 github.com/bnb-chain/ics23 v0.1.0 github.com/cespare/cp v1.1.1 @@ -17,6 +18,7 @@ require ( github.com/cockroachdb/pebble v1.1.5 github.com/cometbft/cometbft v0.37.0 github.com/consensys/gnark-crypto v0.18.1 + github.com/cosmos/iavl v0.12.0 github.com/crate-crypto/go-eth-kzg v1.4.0 github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a github.com/crate-crypto/go-kzg-4844 v1.1.0 @@ -38,7 +40,7 @@ require ( github.com/google/gofuzz v1.2.0 github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad github.com/google/uuid v1.6.0 - github.com/gorilla/mux v1.8.0 + github.com/gorilla/mux v1.8.1 github.com/gorilla/websocket v1.5.3 github.com/graph-gophers/graphql-go v1.3.0 github.com/hashicorp/go-bexpr v0.1.10 @@ -53,7 +55,7 @@ require ( github.com/karalabe/hid v1.0.1-0.20240306101548-573246063e52 github.com/kylelemons/godebug v1.1.0 github.com/logrusorgru/aurora v2.0.3+incompatible - github.com/mattn/go-colorable v0.1.13 + github.com/mattn/go-colorable v0.1.14 github.com/mattn/go-isatty v0.0.20 github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416 github.com/olekukonko/tablewriter v0.0.5 @@ -73,28 +75,27 @@ require ( github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 github.com/tendermint/go-amino v0.14.1 - github.com/tendermint/iavl v0.12.0 github.com/tendermint/tendermint v0.31.15 github.com/tidwall/wal v1.1.7 github.com/urfave/cli/v2 v2.27.5 github.com/wealdtech/go-eth2-wallet-encryptor-keystorev4 v1.1.3 - github.com/willf/bitset v1.1.3 go.uber.org/automaxprocs v1.5.2 go.uber.org/goleak v1.3.0 - golang.org/x/crypto v0.45.0 + golang.org/x/crypto v0.49.0 golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 - golang.org/x/sync v0.18.0 - golang.org/x/sys v0.40.0 - golang.org/x/text v0.31.0 + golang.org/x/sync v0.20.0 + golang.org/x/sys v0.42.0 + golang.org/x/text v0.35.0 golang.org/x/time v0.9.0 - golang.org/x/tools v0.38.0 - google.golang.org/protobuf v1.36.3 + golang.org/x/tools v0.42.0 + google.golang.org/protobuf v1.36.11 gopkg.in/natefinch/lumberjack.v2 v2.2.1 gopkg.in/yaml.v3 v3.0.1 gotest.tools v2.2.0+incompatible ) require ( + github.com/cenkalti/backoff/v5 v5.0.3 // indirect github.com/ferranbt/fastssz v0.1.4 // indirect github.com/fjl/gencodec v0.1.0 // indirect ) @@ -118,9 +119,7 @@ require ( github.com/aws/smithy-go v1.15.0 // indirect github.com/benbjohnson/clock v1.3.5 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/bits-and-blooms/bitset v1.20.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect - github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chzyer/readline v1.5.1 // indirect @@ -168,7 +167,7 @@ require ( github.com/google/gopacket v1.1.19 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect @@ -297,26 +296,26 @@ require ( go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect - go.opentelemetry.io/otel v1.40.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.34.0 // indirect - go.opentelemetry.io/otel/metric v1.40.0 // indirect - go.opentelemetry.io/otel/sdk v1.40.0 // indirect - go.opentelemetry.io/otel/trace v1.40.0 // indirect - go.opentelemetry.io/proto/otlp v1.5.0 // indirect + go.opentelemetry.io/otel v1.43.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.43.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.43.0 // indirect + go.opentelemetry.io/otel/metric v1.43.0 // indirect + go.opentelemetry.io/otel/sdk v1.43.0 // indirect + go.opentelemetry.io/otel/trace v1.43.0 // indirect + go.opentelemetry.io/proto/otlp v1.10.0 // indirect go.uber.org/dig v1.18.0 // indirect go.uber.org/fx v1.23.0 // indirect go.uber.org/mock v0.5.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/mod v0.29.0 // indirect - golang.org/x/net v0.47.0 // indirect - golang.org/x/oauth2 v0.27.0 // indirect - golang.org/x/telemetry v0.0.0-20251008203120-078029d740a8 // indirect - golang.org/x/term v0.37.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect - google.golang.org/grpc v1.69.4 // indirect + golang.org/x/mod v0.33.0 // indirect + golang.org/x/net v0.52.0 // indirect + golang.org/x/oauth2 v0.35.0 // indirect + golang.org/x/telemetry v0.0.0-20260209163413-e7419c687ee4 // indirect + golang.org/x/term v0.41.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 // indirect + google.golang.org/grpc v1.80.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect k8s.io/apimachinery v0.30.4 // indirect diff --git a/go.sum b/go.sum index bf83181536..d623e52d0d 100644 --- a/go.sum +++ b/go.sum @@ -157,8 +157,8 @@ github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtyd github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= -github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= -github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= +github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/cp v1.1.1 h1:nCb6ZLdB7NRaqsm91JtQTAme2SKJzXVsdPIPkyJr1MU= github.com/cespare/cp v1.1.1/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= @@ -221,6 +221,8 @@ github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d h1:49RLWk1j44Xu4fj github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/gogoproto v1.4.1 h1:WoyH+0/jbCTzpKNvyav5FL1ZTWsp1im1MxEpJEzKUB8= github.com/cosmos/gogoproto v1.4.1/go.mod h1:Ac9lzL4vFpBMcptJROQ6dQ4M3pOEK5Z/l0Q9p+LoCr4= +github.com/cosmos/iavl v0.12.0 h1:lcK28rWK6Q/+iKQlMksi/pKnqQZLIdQocSfazSR4fKE= +github.com/cosmos/iavl v0.12.0/go.mod h1:5paARKGkQVKis4t9KbBnXTKdzl+sdDAhR3rIp+iAZzs= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc= @@ -510,8 +512,9 @@ github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORR github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -525,8 +528,8 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92Bcuy github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 h1:VNqngBF40hVlDloBruUehVYC3ArSgIyScOAyMRqBxRg= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1/go.mod h1:RBRO7fro65R6tjKzYgLAFo0t1QEXY1Dp+i/bvpRiqiQ= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 h1:HWRh5R2+9EifMyIHV7ZV+MIZqgz+PMpZ14Jynv3O2Zs= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0/go.mod h1:JfhWUomR1baixubs02l85lZYYOm7LV6om4ceouMv45c= github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= @@ -715,15 +718,14 @@ github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaO github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= +github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= @@ -1114,8 +1116,6 @@ github.com/templexxx/cpufeat v0.0.0-20180724012125-cef66df7f161/go.mod h1:wM7WEv github.com/templexxx/xor v0.0.0-20191217153810-f85b25db303b/go.mod h1:5XA7W9S6mni3h5uvOC75dA3m9CCCaS83lltmc0ukdi4= github.com/tendermint/go-amino v0.14.1 h1:o2WudxNfdLNBwMyl2dqOJxiro5rfrEaU0Ugs6offJMk= github.com/tendermint/go-amino v0.14.1/go.mod h1:i/UKE5Uocn+argJJBb12qTZsCDBcAYMbR92AaJVmKso= -github.com/tendermint/iavl v0.12.0 h1:xcaFAr+ycqCj7WN1RzL2EfcBioRDOHcU1oWcg83K028= -github.com/tendermint/iavl v0.12.0/go.mod h1:EoKMMv++tDOL5qKKVnoIqtVPshRrEPeJ0WsgDOLAauM= github.com/thomaso-mirodin/intmath v0.0.0-20160323211736-5dc6d854e46e h1:cR8/SYRgyQCt5cNCMniB/ZScMkhI9nk8U5C7SbISXjo= github.com/thomaso-mirodin/intmath v0.0.0-20160323211736-5dc6d854e46e/go.mod h1:Tu4lItkATkonrYuvtVjG0/rhy15qrNGNTjPdaphtZ/8= github.com/tidwall/gjson v1.10.2 h1:APbLGOM0rrEkd8WBw9C24nllro4ajFuJu0Sc9hRz8Bo= @@ -1159,8 +1159,6 @@ github.com/wealdtech/go-eth2-wallet-encryptor-keystorev4 v1.1.3 h1:SxrDVSr+oXuT1 github.com/wealdtech/go-eth2-wallet-encryptor-keystorev4 v1.1.3/go.mod h1:qiIimacW5NhVRy8o+YxWo9YrecXqDAKKbL0+sOa0SJ4= github.com/wealdtech/go-eth2-wallet-types/v2 v2.8.2 h1:264/meVYWt1wFw6Mtn+xwkZkXjID42gNra4rycoiDXI= github.com/wealdtech/go-eth2-wallet-types/v2 v2.8.2/go.mod h1:k6kmiKWSWBTd4OxFifTEkPaBLhZspnO2KFD5XJY9nqg= -github.com/willf/bitset v1.1.3 h1:ekJIKh6+YbUIVt9DfNbkR5d6aFcFTLDRyJNAACURBg8= -github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/wlynxg/anet v0.0.3/go.mod h1:eay5PRQr7fIVAMbTbchTnO9gG65Hg/uYGdc7mguHxoA= github.com/wlynxg/anet v0.0.5 h1:J3VJGi1gvo0JwZ/P1/Yc/8p63SoW98B5dHkYDmpgvvU= github.com/wlynxg/anet v0.0.5/go.mod h1:eay5PRQr7fIVAMbTbchTnO9gG65Hg/uYGdc7mguHxoA= @@ -1199,22 +1197,22 @@ go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 h1:CV7UdSGJt/Ao6Gp4CXckLxVRRsRgDHoI8XjbL3PDl8s= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0/go.mod h1:FRmFuRJfag1IZ2dPkHnEoSFVgTVPUd2qf5Vi69hLb8I= -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.34.0 h1:OeNbIYk/2C15ckl7glBlOBp5+WlYsOElzTNmiPW/x60= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0/go.mod h1:7Bept48yIeqxP2OZ9/AqIpYS94h2or0aB4FypJTc8ZM= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.34.0 h1:BEj3SPM81McUZHYjRS5pEgNgnmzGJ5tRpU5krWnV8Bs= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.34.0/go.mod h1:9cKLGBDzI/F3NoHLQGm4ZrYdIHsvGt6ej6hUowxY0J4= -go.opentelemetry.io/otel/metric v1.40.0 h1:rcZe317KPftE2rstWIBitCdVp89A2HqjkxR3c11+p9g= -go.opentelemetry.io/otel/metric v1.40.0/go.mod h1:ib/crwQH7N3r5kfiBZQbwrTge743UDc7DTFVZrrXnqc= -go.opentelemetry.io/otel/sdk v1.40.0 h1:KHW/jUzgo6wsPh9At46+h4upjtccTmuZCFAc9OJ71f8= -go.opentelemetry.io/otel/sdk v1.40.0/go.mod h1:Ph7EFdYvxq72Y8Li9q8KebuYUr2KoeyHx0DRMKrYBUE= -go.opentelemetry.io/otel/sdk/metric v1.40.0 h1:mtmdVqgQkeRxHgRv4qhyJduP3fYJRMX4AtAlbuWdCYw= -go.opentelemetry.io/otel/sdk/metric v1.40.0/go.mod h1:4Z2bGMf0KSK3uRjlczMOeMhKU2rhUqdWNoKcYrtcBPg= -go.opentelemetry.io/otel/trace v1.40.0 h1:WA4etStDttCSYuhwvEa8OP8I5EWu24lkOzp+ZYblVjw= -go.opentelemetry.io/otel/trace v1.40.0/go.mod h1:zeAhriXecNGP/s2SEG3+Y8X9ujcJOTqQ5RgdEJcawiA= -go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4= -go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4= +go.opentelemetry.io/otel v1.43.0 h1:mYIM03dnh5zfN7HautFE4ieIig9amkNANT+xcVxAj9I= +go.opentelemetry.io/otel v1.43.0/go.mod h1:JuG+u74mvjvcm8vj8pI5XiHy1zDeoCS2LB1spIq7Ay0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.43.0 h1:88Y4s2C8oTui1LGM6bTWkw0ICGcOLCAI5l6zsD1j20k= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.43.0/go.mod h1:Vl1/iaggsuRlrHf/hfPJPvVag77kKyvrLeD10kpMl+A= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.43.0 h1:3iZJKlCZufyRzPzlQhUIWVmfltrXuGyfjREgGP3UUjc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.43.0/go.mod h1:/G+nUPfhq2e+qiXMGxMwumDrP5jtzU+mWN7/sjT2rak= +go.opentelemetry.io/otel/metric v1.43.0 h1:d7638QeInOnuwOONPp4JAOGfbCEpYb+K6DVWvdxGzgM= +go.opentelemetry.io/otel/metric v1.43.0/go.mod h1:RDnPtIxvqlgO8GRW18W6Z/4P462ldprJtfxHxyKd2PY= +go.opentelemetry.io/otel/sdk v1.43.0 h1:pi5mE86i5rTeLXqoF/hhiBtUNcrAGHLKQdhg4h4V9Dg= +go.opentelemetry.io/otel/sdk v1.43.0/go.mod h1:P+IkVU3iWukmiit/Yf9AWvpyRDlUeBaRg6Y+C58QHzg= +go.opentelemetry.io/otel/sdk/metric v1.43.0 h1:S88dyqXjJkuBNLeMcVPRFXpRw2fuwdvfCGLEo89fDkw= +go.opentelemetry.io/otel/sdk/metric v1.43.0/go.mod h1:C/RJtwSEJ5hzTiUz5pXF1kILHStzb9zFlIEe85bhj6A= +go.opentelemetry.io/otel/trace v1.43.0 h1:BkNrHpup+4k4w+ZZ86CZoHHEkohws8AY+WTX09nk+3A= +go.opentelemetry.io/otel/trace v1.43.0/go.mod h1:/QJhyVBUUswCphDVxq+8mld+AvhXZLhe+8WVFxiFff0= +go.opentelemetry.io/proto/otlp v1.10.0 h1:IQRWgT5srOCYfiWnpqUYz9CVmbO8bFmKcwYxpuCSL2g= +go.opentelemetry.io/proto/otlp v1.10.0/go.mod h1:/CV4QoCR/S9yaPj8utp3lvQPoqMtxXdzn7ozvvozVqk= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -1267,8 +1265,8 @@ golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= -golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q= -golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4= +golang.org/x/crypto v0.49.0 h1:+Ng2ULVvLHnJ/ZFEq4KdcDd/cfjrrjjNSXNzxg0Y4U4= +golang.org/x/crypto v0.49.0/go.mod h1:ErX4dUh2UM+CFYiXZRTcMpEcN8b/1gxEuv3nODoYtCA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1308,8 +1306,8 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA= -golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w= +golang.org/x/mod v0.33.0 h1:tHFzIWbBifEmbwtGz65eaWyGiGZatSrT9prnU8DbVL8= +golang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1364,8 +1362,8 @@ golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= -golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= -golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= +golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0= +golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1377,8 +1375,8 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.27.0 h1:da9Vo7/tDv5RH/7nZDz1eMGS/q1Vv1N/7FCrBhI9I3M= -golang.org/x/oauth2 v0.27.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= +golang.org/x/oauth2 v0.35.0 h1:Mv2mzuHuZuY2+bkyWXIHMfhNdJAdwW3FuWeCPYN5GVQ= +golang.org/x/oauth2 v0.35.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1393,8 +1391,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I= -golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= +golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= +golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.0.0-20180810173357-98c5dad5d1a0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1471,7 +1469,6 @@ golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1481,10 +1478,10 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ= -golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/telemetry v0.0.0-20251008203120-078029d740a8 h1:LvzTn0GQhWuvKH/kVRS3R3bVAsdQWI7hvfLHGgh9+lU= -golang.org/x/telemetry v0.0.0-20251008203120-078029d740a8/go.mod h1:Pi4ztBfryZoJEkyFTI5/Ocsu2jXyDr6iSdgJiYE/uwE= +golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo= +golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/telemetry v0.0.0-20260209163413-e7419c687ee4 h1:bTLqdHv7xrGlFbvf5/TXNxy/iUwwdkjhqQTJDjW7aj0= +golang.org/x/telemetry v0.0.0-20260209163413-e7419c687ee4/go.mod h1:g5NllXBEermZrmR51cJDQxmJUHUOfRAaNyWBM+R+548= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1493,8 +1490,8 @@ golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= -golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU= -golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254= +golang.org/x/term v0.41.0 h1:QCgPso/Q3RTJx2Th4bDLqML4W6iJiaXFq2/ftQF13YU= +golang.org/x/term v0.41.0/go.mod h1:3pfBgksrReYfZ5lvYM0kSO0LIkAl4Yl2bXOkKP7Ec2A= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1509,8 +1506,8 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM= -golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM= +golang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8= +golang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1580,12 +1577,14 @@ golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ= -golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs= +golang.org/x/tools v0.42.0 h1:uNgphsn75Tdz5Ji2q36v/nsFSfR/9BRFvqhGBaJGd5k= +golang.org/x/tools v0.42.0/go.mod h1:Ma6lCIwGZvHK6XtgbswSoWroEkhugApmsXyrUmBhfr0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y= @@ -1661,10 +1660,10 @@ google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f h1:gap6+3Gk41EItBuyi4XX/bp4oqJ3UwuIMl25yGinuAA= -google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:Ic02D47M+zbarjYYUlK57y316f2MoN0gjAwI3f2S95o= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f h1:OxYkA3wjPsZyBylwymxSHa7ViiW1Sml4ToBrncvFehI= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:+2Yz8+CLJbIfL9z73EW45avw8Lmge3xVElCP9zEKi50= +google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9 h1:VPWxll4HlMw1Vs/qXtN7BvhZqsS9cdAittCNvVENElA= +google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9/go.mod h1:7QBABkRtR8z+TEnmXTqIqwJLlzrZKVfAUm7tY3yGv0M= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 h1:m8qni9SQFH0tJc1X0vmnpw/0t+AImlSvp30sEupozUg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= @@ -1688,8 +1687,8 @@ google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.69.4 h1:MF5TftSMkd8GLw/m0KM6V8CMOCY6NZ1NQDPGFgbTt4A= -google.golang.org/grpc v1.69.4/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= +google.golang.org/grpc v1.80.0 h1:Xr6m2WmWZLETvUNvIUmeD5OAagMw3FiKmMlTdViWsHM= +google.golang.org/grpc v1.80.0/go.mod h1:ho/dLnxwi3EDJA4Zghp7k2Ec1+c2jqup0bFkw07bwF4= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1700,8 +1699,8 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.36.3 h1:82DV7MYdb8anAVi3qge1wSnMDrnKK7ebr+I0hHRN1BU= -google.golang.org/protobuf v1.36.3/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/bsm/ratelimit.v1 v1.0.0-20160220154919-db14e161995a/go.mod h1:KF9sEfUPAXdG8Oev9e99iLGnl2uJMjc5B+4y3O7x610= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 46a2de9f49..52ddcce568 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1383,6 +1383,7 @@ func (api *BlockChainAPI) replay(ctx context.Context, block *types.Block, accoun if posa, ok := api.b.Engine().(consensus.PoSA); ok { if isSystem, _ := posa.IsSystemTransaction(tx, block.Header()); isSystem { + msg.SkipTransactionChecks = true balance := statedb.GetBalance(consensus.SystemAddress) if balance.Cmp(common.U2560) > 0 { statedb.SetBalance(consensus.SystemAddress, uint256.NewInt(0), tracing.BalanceChangeUnspecified) diff --git a/internal/ethapi/simulate.go b/internal/ethapi/simulate.go index dd526baf84..377ca33cab 100644 --- a/internal/ethapi/simulate.go +++ b/internal/ethapi/simulate.go @@ -125,10 +125,6 @@ func (m *simChainHeadReader) CurrentHeader() *types.Header { return m.Backend.CurrentHeader() } -func (m *simChainHeadReader) ChasingHead() *types.Header { - return m.Backend.Chain().ChasingHead() -} - func (m *simChainHeadReader) GetHeader(hash common.Hash, number uint64) *types.Header { header, err := m.Backend.HeaderByNumber(m.Context, rpc.BlockNumber(number)) if err != nil || header == nil { diff --git a/miner/bid_simulator.go b/miner/bid_simulator.go index ec5ba0eae0..e8d34c20b7 100644 --- a/miner/bid_simulator.go +++ b/miner/bid_simulator.go @@ -42,6 +42,9 @@ var ( simulateSpeedGauge = metrics.NewRegisteredGauge("bid/sim/simulateSpeed", nil) // mgasps bidSimTimeoutCounter = metrics.NewRegisteredCounter("bid/sim/simTimeout", nil) + + // greedyMergeOnchainCounter counts bids that went through greedy merge and were finally chosen as BUILDER BLOCK. + greedyMergeOnchainCounter = metrics.NewRegisteredCounter("bid/greedyMerge/onchain", nil) ) var ( @@ -762,6 +765,8 @@ func (b *bidSimulator) simBid(interruptCh chan int32, bidRuntime *BidRuntime) { } }(startTS) + startAsyncBlobValidation(bidRuntime.bid) + // prepareWork will configure header with a suitable time according to consensus // prepareWork will start trie prefetching if bidRuntime.env, err = b.bidWorker.prepareWork(&generateParams{ @@ -903,11 +908,14 @@ func (b *bidSimulator) simBid(interruptCh chan int32, bidRuntime *BidRuntime) { // if enable greedy merge, fill bid env with transactions from mempool greedyMergeElapsed := time.Duration(0) if *b.config.GreedyMergeTx { - endingBidsExtra := 20 * time.Millisecond // Add a buffer to ensure ending bids before `delayLeftOver` + endingBidsExtra := 10 * time.Millisecond // Add a buffer to ensure ending bids before `delayLeftOver` minTimeLeftForEndingBids := b.delayLeftOver + endingBidsExtra delay := b.engine.Delay(b.chain, bidRuntime.env.header, &minTimeLeftForEndingBids) if delay != nil && *delay > 0 { greedyMergeStartTs := time.Now() + rewardBefore := new(big.Int).Set(bidRuntime.packedBlockReward) + tcountBefore := bidRuntime.env.tcount + bidRuntime.greedyMerged = true bidTxsSet := mapset.NewThreadUnsafeSetWithSize[common.Hash](len(bidRuntime.bid.Txs)) for _, tx := range bidRuntime.bid.Txs { bidTxsSet.Add(tx.Hash()) @@ -919,9 +927,12 @@ func (b *bidSimulator) simBid(interruptCh chan int32, bidRuntime *BidRuntime) { // recalculate the packed reward bidRuntime.packReward(*b.config.ValidatorCommission) greedyMergeElapsed = time.Since(greedyMergeStartTs) + addedTx := bidRuntime.env.tcount - tcountBefore + rewardDelta := new(big.Int).Sub(bidRuntime.packedBlockReward, rewardBefore) log.Debug("BidSimulator: greedy merge stopped", "block", bidRuntime.env.header.Number, - "builder", bidRuntime.bid.Builder, "tx count", bidRuntime.env.tcount-bidTxLen+1, "err", fillErr, "greedyMergeElapsed", greedyMergeElapsed) + "builder", bidRuntime.bid.Builder, "addedTx", addedTx, "rewardDelta", weiToEtherStringF6(rewardDelta), + "budget", *delay, "elapsed", greedyMergeElapsed, "err", fillErr) } } @@ -1005,6 +1016,8 @@ type BidRuntime struct { finished chan struct{} duration time.Duration + + greedyMerged bool } func newBidRuntime(newBid *types.Bid, validatorCommission uint64) (*BidRuntime, error) { @@ -1080,9 +1093,15 @@ func (r *BidRuntime) commitTransaction(chain *core.BlockChain, chainConfig *para return errors.New("cell proof is not supported yet") } - // Validate blob sidecar commitment hashes and KZG proofs. - if err := txpool.ValidateBlobTx(tx, env.header, nil); err != nil { - return err + if ch, ok := r.bid.BlobValResults[tx.Hash()]; ok { + delete(r.bid.BlobValResults, tx.Hash()) + if err := <-ch; err != nil { + return err + } + } else { + if err := txpool.ValidateBlobTx(tx, env.header, nil); err != nil { + return err + } } // Checking against blob gas limit: It's kind of ugly to perform this check here, but there diff --git a/miner/miner_mev.go b/miner/miner_mev.go index 69a9195d15..7f7b0cf4b6 100644 --- a/miner/miner_mev.go +++ b/miner/miner_mev.go @@ -7,11 +7,17 @@ import ( "time" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/txpool" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/internal/version" "github.com/ethereum/go-ethereum/log" ) +const ( + maxBlobValConcurrency = 3 + maxBlobTxPerBlock = 6 +) + // MevRunning return true if mev is running. func (miner *Miner) MevRunning() bool { return miner.bidSimulator.isRunning() && miner.bidSimulator.receivingBid() @@ -80,6 +86,51 @@ func (miner *Miner) SendBid(ctx context.Context, bidArgs *types.BidArgs) (common return bid.Hash(), nil } +// startAsyncBlobValidation uses a fixed-size worker pool to validate blob +// transactions in the background (field checks + KZG proof verification). +// Results are stored per-tx in bid.BlobValResults keyed by tx hash. +func startAsyncBlobValidation(bid *types.Bid) { + type blobJob struct { + tx *types.Transaction + ch chan error + } + + bid.BlobValResults = make(map[common.Hash]chan error) + jobs := make([]blobJob, 0, maxBlobTxPerBlock) + + for _, tx := range bid.Txs { + if tx.Type() == types.BlobTxType { + if _, dup := bid.BlobValResults[tx.Hash()]; dup { + continue + } + ch := make(chan error, 1) + bid.BlobValResults[tx.Hash()] = ch + jobs = append(jobs, blobJob{tx: tx, ch: ch}) + if len(jobs) >= maxBlobTxPerBlock { + break + } + } + } + + jobCh := make(chan blobJob, len(jobs)) + for _, j := range jobs { + jobCh <- j + } + close(jobCh) + + workers := len(jobs) + if workers > maxBlobValConcurrency { + workers = maxBlobValConcurrency + } + for i := 0; i < workers; i++ { + go func() { + for j := range jobCh { + j.ch <- txpool.ValidateBlobTx(j.tx, nil, nil) + } + }() + } +} + func (miner *Miner) MevParams() *types.MevParams { builderFeeCeil, ok := big.NewInt(0).SetString(*miner.worker.config.Mev.BuilderFeeCeil, 10) if !ok { diff --git a/miner/miner_mev_test.go b/miner/miner_mev_test.go new file mode 100644 index 0000000000..abd4627099 --- /dev/null +++ b/miner/miner_mev_test.go @@ -0,0 +1,87 @@ +package miner + +import ( + "crypto/rand" + "testing" + + "github.com/consensys/gnark-crypto/ecc/bls12-381/fr" + gokzg4844 "github.com/crate-crypto/go-eth-kzg" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/crypto/kzg4844" + "github.com/ethereum/go-ethereum/params" + "github.com/holiman/uint256" +) + +func randFieldElement() [32]byte { + bytes := make([]byte, 32) + _, err := rand.Read(bytes) + if err != nil { + panic("failed to get random field element") + } + var r fr.Element + r.SetBytes(bytes) + return gokzg4844.SerializeScalar(r) +} + +func randBlob() kzg4844.Blob { + var blob kzg4844.Blob + for i := 0; i < len(blob); i += gokzg4844.SerializedScalarSize { + fieldElementBytes := randFieldElement() + copy(blob[i:i+gokzg4844.SerializedScalarSize], fieldElementBytes[:]) + } + return blob +} + +func makeSignedBlobTx(nonce uint64, sidecar *types.BlobTxSidecar) *types.Transaction { + key, _ := crypto.GenerateKey() + blobtx := &types.BlobTx{ + ChainID: uint256.MustFromBig(params.MainnetChainConfig.ChainID), + Nonce: nonce, + GasTipCap: uint256.NewInt(1), + GasFeeCap: uint256.NewInt(1000), + Gas: 21000, + BlobFeeCap: uint256.NewInt(1), + BlobHashes: sidecar.BlobHashes(), + Value: uint256.NewInt(0), + Sidecar: sidecar, + } + tx := types.NewTx(blobtx) + signed, _ := types.SignTx(tx, types.NewCancunSigner(params.MainnetChainConfig.ChainID), key) + return signed +} + +func validBlobSidecar(n int) *types.BlobTxSidecar { + blobs := make([]kzg4844.Blob, n) + commitments := make([]kzg4844.Commitment, n) + proofs := make([]kzg4844.Proof, n) + for i := 0; i < n; i++ { + blobs[i] = randBlob() + c, _ := kzg4844.BlobToCommitment(&blobs[i]) + commitments[i] = c + p, _ := kzg4844.ComputeBlobProof(&blobs[i], c) + proofs[i] = p + } + return types.NewBlobTxSidecar(types.BlobSidecarVersion0, blobs, commitments, proofs) +} + +// TestStartAsyncBlobValidation_InvalidProof verifies that the async blob +// validation goroutine correctly detects a tampered blob proof. +func TestStartAsyncBlobValidation_InvalidProof(t *testing.T) { + sidecar := validBlobSidecar(1) + sidecar.Proofs[0][0] ^= 0xff + + tx := makeSignedBlobTx(0, sidecar) + bid := &types.Bid{ + Txs: types.Transactions{tx}, + } + startAsyncBlobValidation(bid) + + ch, ok := bid.BlobValResults[tx.Hash()] + if !ok { + t.Fatal("expected BlobValResults to contain the blob tx") + } + if err := <-ch; err == nil { + t.Fatal("expected error for invalid KZG proof") + } +} diff --git a/miner/worker.go b/miner/worker.go index cfe9abb8d6..c275ea8f11 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -1442,6 +1442,9 @@ LOOP: // blockReward(benefits delegators) and validatorReward(benefits the validator) are both optimal if localValidatorReward.CmpBig(bestBid.packedValidatorReward) < 0 { bidWinGauge.Inc(1) + if bestBid.greedyMerged { + greedyMergeOnchainCounter.Inc(1) + } bestWork = bestBid.env diff --git a/params/config.go b/params/config.go index a7378767d7..8e9b40398a 100644 --- a/params/config.go +++ b/params/config.go @@ -250,10 +250,10 @@ var ( LorentzTime: newUint64(1745903100), // 2025-04-29 05:05:00 AM UTC MaxwellTime: newUint64(1751250600), // 2025-06-30 02:30:00 AM UTC FermiTime: newUint64(1768357800), // 2026-01-14 02:30:00 AM UTC - OsakaTime: nil, - MendelTime: nil, - BPO1Time: nil, // will be skipped in BSC - BPO2Time: nil, // will be skipped in BSC + OsakaTime: newUint64(1777343400), // 2026-04-28 02:30:00 AM UTC + MendelTime: newUint64(1777343400), // 2026-04-28 02:30:00 AM UTC + BPO1Time: nil, // will be skipped in BSC + BPO2Time: nil, // will be skipped in BSC AmsterdamTime: nil, PasteurTime: nil, diff --git a/version/version.go b/version/version.go index e6bc50c436..e52a90d33b 100644 --- a/version/version.go +++ b/version/version.go @@ -19,6 +19,6 @@ package version const ( Major = 1 // Major version component of the current release Minor = 7 // Minor version component of the current release - Patch = 1 // Patch version component of the current release + Patch = 3 // Patch version component of the current release Meta = "" // Version metadata to append to the version string )