Skip to content

Conversation

@AnnaShaleva
Copy link
Member

@AnnaShaleva AnnaShaleva commented Jun 21, 2024

This PR merges v1.13.15 of Geth into bane-main and aimed to close #188.

Close #291.

  • The node functions normally and consensus runs fine (1/4/7 privnet).
  • Mainnet/T4 sync is OK.

UPD on the compatibility problem described earlier: there's actually no compatibility problems with the 1.13.15 version merge. Turns out that Geth v1.13.15 was an unclean release from non-master branch. It's based on v1.13.14 with five additional commits cherry-picked (ref. ethereum/go-ethereum#29556, the release branch itself is https://github.com/ethereum/go-ethereum/tree/release/1.13).

The list of important PRs that were merged. @txhsl, @chenquanyu, please take a look at these PRs before the review.

Also, it would be nice if you double-check the merged commits, maybe you'll find something important that we should react to.

karalabe and others added 30 commits November 14, 2023 15:02
…879)

This adds an error if the signer returns a nil value for one of the signature value fields.
The hyperlink in the README file that directs to the Travis CI build was broken.
This commit updates the link to point to the corrent build page.
At some point, `ForkchoiceUpdatedV2` stopped working for `PayloadAttributesV1` while `paris` was active. This was causing a few failures in hive. This PR fixes that, and also adds a gate in `ForkchoiceUpdatedV1` to disallow `PayloadAttributesV3`.
This pull request resets the txlookup cache if chain reorg happens, 
preventing them from remaining reachable. It addresses failures in
the hive tests.
* eth/downloader: fix skeleton cleanup

* eth/downloader: short circuit if nothing to delete

* eth/downloader: polish the logic in cleanup

* eth/downloader: address comments
… (#28914)

* core/txpool/blobpool: clean up resurrected junk after a crash

* core/txpool/blobpool: track transaction insertions and rejections

* core/txpool/blobpool: linnnnnnnt
…er (#28917)

* core/txpool: don't inject lazy resolved transactions into the container

* core/txpool: minor typo fixes
Co-authored-by: Martin HS <martin@swende.se>
Co-authored-by: Felix Lange <fjl@twurst.com>
* eth, miner: fix enforcing the minimum miner tip

* ethclient/simulated: fix failing test due the min tip change

* accounts/abi/bind: fix simulater gas tip issue
* all: implement era format, add history importer/export

* internal/era/e2store: refactor e2store to provide ReadAt interface

* internal/era/e2store: export HeaderSize

* internal/era: refactor era to use ReadAt interface

* internal/era: elevate anonymous func to named

* cmd/utils: don't store entire era file in-memory during import / export

* internal/era: better abstraction between era and e2store

* cmd/era: properly close era files

* cmd/era: don't let defers stack

* cmd/geth: add description for import-history

* cmd/utils: better bytes buffer

* internal/era: error if accumulator has more records than max allowed

* internal/era: better doc comment

* internal/era/e2store: rm superfluous reader, rm superfluous testcases, add fuzzer

* internal/era: avoid some repetition

* internal/era: simplify clauses

* internal/era: unexport things

* internal/era,cmd/utils,cmd/era: change to iterator interface for reading era entries

* cmd/utils: better defer handling in history test

* internal/era,cmd: add number method to era iterator to get the current block number

* internal/era/e2store: avoid double allocation during write

* internal/era,cmd/utils: fix lint issues

* internal/era: add ReaderAt func so entry value can be read lazily

Co-authored-by: lightclient <lightclient@protonmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>

* internal/era: improve iterator interface

* internal/era: fix rlp decode of header and correctly read total difficulty

* cmd/era: fix rebase errors

* cmd/era: clearer comments

* cmd,internal: fix comment typos

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
@AnnaShaleva AnnaShaleva requested a review from roman-khimov June 21, 2024 16:24
@AnnaShaleva AnnaShaleva changed the title WIP: Merge Geth v1.13.15 Merge Geth v1.13.15 Jun 27, 2024
msg.GasTipCap is nil, but I'm not sure why, it shouldn't be like that
in the real network.

```
--- FAIL: TestExecutionSpecState (0.01s)
    --- FAIL: TestExecutionSpecState/berlin/eip2930_access_list/acl/access_list.json (0.00s)
        --- FAIL: TestExecutionSpecState/berlin/eip2930_access_list/acl/access_list.json/tests/berlin/eip2930_access_list/test_acl.py::test_access_list[fork_Berlin-state_test] (0.00s)
            --- FAIL: TestExecutionSpecState/berlin/eip2930_access_list/acl/access_list.json/tests/berlin/eip2930_access_list/test_acl.py::test_access_list[fork_Berlin-state_test]/Berlin/0/hash/trie (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x5e2ad8]

goroutine 78973 [running]:
testing.tRunner.func1.2({0xd79340, 0x162a1b0})
	/usr/local/go/src/testing/testing.go:1631 +0x24a
testing.tRunner.func1()
	/usr/local/go/src/testing/testing.go:1634 +0x377
panic({0xd79340?, 0x162a1b0?})
	/usr/local/go/src/runtime/panic.go:770 +0x132
math/big.(*Int).Cmp(0x0?, 0x0?)
	/usr/local/go/src/math/big/int.go:381 +0x18
github.com/ethereum/go-ethereum/core.(*StateTransition).preCheck(0xc001317628)
	/home/anna/Documents/GitProjects/bane-labs/go-ethereum/core/state_transition.go:300 +0x485
github.com/ethereum/go-ethereum/core.(*StateTransition).TransitionDb(0xc001317628)
	/home/anna/Documents/GitProjects/bane-labs/go-ethereum/core/state_transition.go:393 +0x51
github.com/ethereum/go-ethereum/core.ApplyMessage(0x0?, 0xf97800?, 0xf96f28?)
	/home/anna/Documents/GitProjects/bane-labs/go-ethereum/core/state_transition.go:184 +0x57
github.com/ethereum/go-ethereum/tests.(*StateTest).RunNoVerify(0xc0001794a0, {{0xc000353730?, 0xc001142006?}, 0x7dc007fd8a68?}, {{0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, ...}}, ...)
	/home/anna/Documents/GitProjects/bane-labs/go-ethereum/tests/state_test_util.go:301 +0x9e5
github.com/ethereum/go-ethereum/tests.(*StateTest).Run(0xc0001794a0, {{0xc000353730?, 0x6?}, 0x0?}, {{0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, ...}}, ...)
	/home/anna/Documents/GitProjects/bane-labs/go-ethereum/tests/state_test_util.go:198 +0xf7
github.com/ethereum/go-ethereum/tests.execStateTest.func1.1({{0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, 0x0}})
	/home/anna/Documents/GitProjects/bane-labs/go-ethereum/tests/state_test.go:113 +0xef
github.com/ethereum/go-ethereum/tests.withTrace(0xc001129520, 0x4ef00, 0xc001317f18)
	/home/anna/Documents/GitProjects/bane-labs/go-ethereum/tests/state_test.go:167 +0x75
github.com/ethereum/go-ethereum/tests.execStateTest.func1(0xc001129520)
	/home/anna/Documents/GitProjects/bane-labs/go-ethereum/tests/state_test.go:111 +0x12b
testing.tRunner(0xc001129520, 0xc002c0d350)
	/usr/local/go/src/testing/testing.go:1689 +0xfb
created by testing.(*T).Run in goroutine 78972
	/usr/local/go/src/testing/testing.go:1742 +0x390

```

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
Support for eth/67 was dropped in 8a76a81.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
core: fix filing test after v1.13.15 merge
@AnnaShaleva
Copy link
Member Author

Tests pass, but privnet isn't running:

INFO [08-09|19:38:45.069] HTTP server started                      endpoint=[::]:8562 auth=false prefix= cors= vhosts=*
INFO [08-09|19:38:45.070] WebSocket enabled                        url=ws://[::]:8572
INFO [08-09|19:38:45.071] WebSocket enabled                        url=ws://127.0.0.1:8552
INFO [08-09|19:38:45.071] HTTP server started                      endpoint=127.0.0.1:8552 auth=true  prefix= cors=localhost vhosts=localhost
INFO [08-09|19:38:46.638] Unlocked account                         address=0x74f4EFFb0B538BAec703346b03B6d9292f53A4CD
INFO [08-09|19:38:46.638] Legacy pool tip threshold updated        tip=0
INFO [08-09|19:38:46.638] Legacy pool tip threshold updated        tip=1,000,000,000
INFO [08-09|19:38:46.638] Initializing BFT consensus               account=0x74f4EFFb0B538BAec703346b03B6d9292f53A4CD
INFO [08-09|19:38:46.638] Snap sync complete, auto disabling
INFO [08-09|19:38:46.638] Fetching latest sealing proposal         "desired number"=1
INFO [08-09|19:38:46.639] Commit new sealing work                  number=1 sealhash=e66155..adaa87 "parent hash"=edba97..2eac00 etherbase=0x1212000000000000000000000000000000000003 txs=0 gas=0 fees=0 elapsed="171.163µs"
INFO [08-09|19:38:47.640] Sealing proposal updated                 number=1 sealhash=e66155..adaa87 "parent hash"=edba97..2eac00 txs=0
INFO [08-09|19:38:47.640] Starting dBFT engine                     "last height"=0 "last timestamp"=0
panic: failed to retrieve next block validators: failed to perform 'getCurrentConsensus' call: execution reverted

goroutine 4252 [running]:
github.com/ethereum/go-ethereum/consensus/dbft.New.func4({0x0, 0xc75aa85fa0766dab?, 0x1304c9266330c603?})
	github.com/ethereum/go-ethereum/consensus/dbft/dbft.go:326 +0x216
github.com/nspcc-dev/dbft.(*Context[...]).reset(0x1f8e0a0, 0x0, 0x2c)
	github.com/nspcc-dev/dbft@v0.2.0/context.go:201 +0xba
github.com/nspcc-dev/dbft.(*DBFT[...]).initializeConsensus(0x1f92ba0, 0x0, 0xc00012afc8)
	github.com/nspcc-dev/dbft@v0.2.0/dbft.go:88 +0x45
github.com/nspcc-dev/dbft.(*DBFT[...]).Start(0x1f92ba0, 0x0)
	github.com/nspcc-dev/dbft@v0.2.0/dbft.go:74 +0x67
github.com/ethereum/go-ethereum/consensus/dbft.(*DBFT).Start(0x0?, {0x1f78150?, 0xc000427808?})
	github.com/ethereum/go-ethereum/consensus/dbft/dbft.go:1133 +0x3eb
created by github.com/ethereum/go-ethereum/eth.(*Ethereum).StartMining in goroutine 1
	github.com/ethereum/go-ethereum/eth/backend.go:524 +0x6c9

I'm fixing it. @txhsl, @chenquanyu from your side regarding base fee changes I need you to take a look at ethereum/go-ethereum#28933 and ethereum/go-ethereum#29005 and check whether we need to adjust fees related code. From my PoW we can go without any additional changes, but may be I'm wrong.

@txhsl
Copy link
Contributor

txhsl commented Aug 12, 2024

@txhsl, @chenquanyu from your side regarding base fee changes I need you to take a look at ethereum/go-ethereum#28933 and ethereum/go-ethereum#29005 and check whether we need to adjust fees related code.

Yes, I think we can go without any additional changes. I'm glad to see that a minimum fee setting was finally applied to the blob pool, it made the codes reasonable.

But before we enable the blob transactions when release v0.2.2, we need to apply our policy limit to the pool properly, ref #266.

@AnnaShaleva
Copy link
Member Author

panic: failed to retrieve next block validators: failed to perform 'getCurrentConsensus' call: execution reverted

Regarding this problem:

  1. Mainnet/testnet synchronisation fails with the same error on the top of the current version of PR.
  2. I tried to locate the source of this error, and it seems to me that it goes from the Governance contract code itself. Given the fact that privnet is running OK on both current master (eef0b96) and on old branch with v1.13.15 changes on the top of it (e828bfc) I suspect that something has been changed in both Geth v1.13.11+ and compiled Governance version which leads to the execution revert.
  3. I located the commit starting from which privnet fails with this error. It's ee1cfc8, in this commit Governance contract (and a couple of other contracts) were updated to fetch recent changes.
  4. Now I'm trying to locate commit from Geth v1.13.11+ that leads to this error and connected with changes in Governance introduced by ee1cfc8. I suppose that it should be some change in the VM opcode processing, may be yet another bug fix, or something related to Shanghai opcodes processing, because ee1cfc8 includes a compiler target switch (to Shanghai).

@txhsl
Copy link
Contributor

txhsl commented Aug 13, 2024

panic: failed to retrieve next block validators: failed to perform 'getCurrentConsensus' call: execution reverted

It is hard to figure out the reason, since the only log we can see is execution reverted. I'll check this contract calling from Cancun version as well.

@AnnaShaleva
Copy link
Member Author

I'll check this contract calling from Shanghai version as well.

Just to clarify: I don’t think it’s the contract’s fault. It looks like something has been changed in the VM processors.

@txhsl
Copy link
Contributor

txhsl commented Aug 14, 2024

Just some results, I tried several test cases about eth_Call based on both bane-main and this branch. I sent getCurrentConsensus() request to different addresses, so the method hash is 0x9f9d7f81.

Address without any code Contract with the method Proxy contract without the method Normal contract without the method
bane-main 0x {correct data} execution reverted execution reverted
upd-v1.13.15 0x execution reverted execution reverted invalid opcode: PUSH0

Partially revert ethereum/go-ethereum#29023.
This commit intentionally breaks the post-merge hardforks logic to fix
the problem described in
#232 (comment).

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
@AnnaShaleva
Copy link
Member Author

Let me do the final checks with mainnet/testnet sync.

@AnnaShaleva
Copy link
Member Author

Mainnet sync passes:

2024-08-14T19:27:06.130+0300	DEBUG	dbft@v0.2.0/dbft.go:214	received message	{"type": "Commit", "from": 2, "height": 144802, "view": 0, "my_height": 144802, "my_view": 0}
2024-08-14T19:27:06.130+0300	INFO	dbft@v0.2.0/dbft.go:498	received Commit	{"validator": 2}
2024-08-14T19:27:06.131+0300	INFO	dbft@v0.2.0/check.go:65	approving block	{"height": 144802, "hash": "0xf98bcbefc6f8b9972d904dbe18e0ddba60d5750c166b29420f8c92e469bd070e", "tx_count": 0, "merkle": "0x6c42725a23c7319177fbee1a7b737684ea07a1268e565766efd30983d9d62082", "prev": "0x86cdb96a0f2139db487f326f4c9cb831b0b65a984ac18d8909e32921ba04bc91"}
INFO [08-14|19:27:06.141] Chain reorg detected                     number=144,800 hash=2363f2..b0269d drop=1 dropfrom=5fea5a..bdd62e add=2 addfrom=9b648e..79888f
INFO [08-14|19:27:06.143] Successfully wrote new block with state  number=144,802 hash=9b648e..79888f
INFO [08-14|19:27:06.144] New block in the chain                   "dbft index"=144,802 "chain index"=144,802 hash=0x9b648e17fb85f30d3883fdabe6ed39568182b2f44e4c5377cad2406cd879888f "parent hash"=0x86cdb96a0f2139db487f326f4c9cb831b0b65a984ac18d8909e32921ba04bc91 primary=0 coinbase=0x1212000000000000000000000000000000000003 "mix digest"=0xeb59c093e3a02bfa4e0d4677d4769022cd9399bbc8b93ad1e892acd6a08aa533
INFO [08-14|19:27:06.144] Fetching latest sealing proposal         "desired number"=144,803
INFO [08-14|19:27:06.145] Commit new sealing work                  number=144,803 sealhash=416eab..b0ee09 "parent hash"=9b648e..79888f etherbase=0x1212000000000000000000000000000000000003 txs=0   gas=0 fees=0 elapsed=1.316ms

Testnet sync passes, although testnet sync is significantly slower than it should be due to #296, will fix it in another PR.

2024-08-14T20:04:37.689+0300	DEBUG	dbft@v0.2.0/check.go:56	not enough to commit	{"count": 3}
2024-08-14T20:04:37.704+0300	DEBUG	dbft@v0.2.0/dbft.go:214	received message	{"type": "Commit", "from": 0, "height": 262743, "view": 0, "my_height": 262743, "my_view": 0}
2024-08-14T20:04:37.705+0300	INFO	dbft@v0.2.0/dbft.go:498	received Commit	{"validator": 0}
2024-08-14T20:04:37.705+0300	DEBUG	dbft@v0.2.0/check.go:56	not enough to commit	{"count": 4}
2024-08-14T20:04:37.709+0300	DEBUG	dbft@v0.2.0/dbft.go:214	received message	{"type": "Commit", "from": 3, "height": 262743, "view": 0, "my_height": 262743, "my_view": 0}
2024-08-14T20:04:37.710+0300	INFO	dbft@v0.2.0/dbft.go:498	received Commit	{"validator": 3}
2024-08-14T20:04:37.710+0300	INFO	dbft@v0.2.0/check.go:65	approving block	{"height": 262743, "hash": "0xc57abd59633ab12a21ba5cbe948d43c461b2bc014687588b238cb47e87448ae8", "tx_count": 0, "merkle": "0xfcf7c365f64b3b366b57f37a40b05932cf23bf8d129accefb97eacea3c7f7424", "prev": "0xc7f1bda8c45e4b284075e3d487cf9168cbbae905dc5a6b2b08da1fce627e766a"}
INFO [08-14|20:04:37.720] Chain reorg detected                     number=262,741 hash=cd2b8e..6dfdc2 drop=1 dropfrom=23a935..770ad2 add=2 addfrom=d207b3..da9204
INFO [08-14|20:04:37.722] Successfully wrote new block with state  number=262,743 hash=d207b3..da9204
INFO [08-14|20:04:37.722] New block in the chain                   "dbft index"=262,743 "chain index"=262,743 hash=0xd207b35ffecc3d369433d342219d7e895ca43dcce8570871c8160824bada9204 "parent hash"=0xc7f1bda8c45e4b284075e3d487cf9168cbbae905dc5a6b2b08da1fce627e766a primary=5 coinbase=0x1212000000000000000000000000000000000003 "mix digest"=0x072bc064323344cba6d63cad4ca88afbea585fc612919e3e351f457ea3704f76
INFO [08-14|20:04:37.722] Fetching latest sealing proposal         "desired number"=262,744
INFO [08-14|20:04:37.724] Commit new sealing work                  number=262,744 sealhash=adf000..a9943a "parent hash"=d207b3..da9204 etherbase=0x1212000000000000000000000000000000000003 txs=0    gas=0 fees=0 elapsed=1.808ms
INFO [08-14|20:04:38.724] Sealing proposal updated                 number=262,744 sealhash=adf000..a9943a "parent hash"=d207b3..da9204 txs=0
2024-08-14T20:04:38.725+0300	INFO	dbft@v0.2.0/dbft.go:107	initializing dbft	{"height": 262744, "view": 0, "index": -1, "role": "WatchOnly"}
2024-08-14T20:04:38.725+0300	DEBUG	dbft@v0.2.0/dbft.go:214	received message	{"type": "Commit", "from": 1, "height": 262743, "view": 0, "my_height": 262744, "my_view": 0}
2024-08-14T20:04:38.725+0300	DEBUG	dbft@v0.2.0/dbft.go:223	ignoring old height	{"height": 262743}
INFO [08-14|20:04:47.567] Looking for peers                        peercount=1 tried=215 static=0

Ready for the merge.

@AnnaShaleva AnnaShaleva requested a review from txhsl August 14, 2024 17:05
@AnnaShaleva
Copy link
Member Author

@txhsl, @roman-khimov, please review&merge.

Copy link
Contributor

@roman-khimov roman-khimov left a comment

Choose a reason for hiding this comment

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

Can't say much about upstream changes, but adaptation is rather clear and if tests are fine then it's OK.

@txhsl
Copy link
Contributor

txhsl commented Aug 15, 2024

Will merge this after some necessary tests from our side.

@txhsl txhsl merged commit 7717358 into bane-main Aug 15, 2024
@txhsl txhsl deleted the upd-v1.13.15 branch August 15, 2024 08:09
@AnnaShaleva AnnaShaleva mentioned this pull request Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mismatching block hash and transaction receipt data Update Geth to v1.13+