-
-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: v1.27.1 release #7493
Merged
Merged
chore: v1.27.1 release #7493
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…() (#7478) **Motivation** - got this issue in Gnosis Tested this but on first consolidation same target and source validator it apparently worked fine. However, the erigon-lodestar validator node that proposed the consolidation request transaction rejected all peers and forked. It is stuck on this slot: [link](http://45.79.201.144:8083/slot/68121) Lodestar shows these errors: ``` Feb-17 07:11:09.621[chain] debug: Block error slot=68121, code=BLOCK_ERROR_INVALID_STATE_ROOT, slot=68121, root=0xb8362da32e9ba60bb4e76aa3dae3cf3722404f97be7d674a1ba2d61140bae2f0, expectedRoot=0xb3e18d8a01cb01ac43a0e2fc4d11f6f9298d74ed51ed8520f0597001e4499516 Error: BLOCK_ERROR_INVALID_STATE_ROOT at verifyBlocksStateTransitionOnly (file:///usr/app/packages/beacon-node/src/chain/blocks/verifyBlocksStateTransitionOnly.ts:71:13) at BeaconChain.verifyBlocksInEpoch (file:///usr/app/packages/beacon-node/src/chain/blocks/verifyBlock.ts:114:7) at BeaconChain.processBlocks (file:///usr/app/packages/beacon-node/src/chain/blocks/index.ts:74:7) at JobItemQueue.runJob (file:///usr/app/packages/beacon-node/src/util/queue/itemQueue.ts:102:22) Feb-17 07:11:09.622[sync] verbose: Batch process error id=Finalized, startEpoch=4257, status=Processing, code=BLOCK_ERROR_INVALID_STATE_ROOT, slot=68121, root=0xb8362da32e9ba60bb4e76aa3dae3cf3722404f97be7d674a1ba2d61140bae2f0, expectedRoot=0xb3e18d8a01cb01ac43a0e2fc4d11f6f9298d74ed51ed8520f0597001e4499516 Error: BLOCK_ERROR_INVALID_STATE_ROOT at verifyBlocksStateTransitionOnly (file:///usr/app/packages/beacon-node/src/chain/blocks/verifyBlocksStateTransitionOnly.ts:71:13) at BeaconChain.verifyBlocksInEpoch (file:///usr/app/packages/beacon-node/src/chain/blocks/verifyBlock.ts:114:7) at BeaconChain.processBlocks (file:///usr/app/packages/beacon-node/src/chain/blocks/index.ts:74:7) at JobItemQueue.runJob (file:///usr/app/packages/beacon-node/src/util/queue/itemQueue.ts:102:22) ``` The rest of the nodes are working the fine, even nethermind-lodestar, and the validator seems to have updated to 0x02 withdrawal credentials type. [link](http://45.79.201.144:8083/validator/2000) closes #7487 **Description** - although it's not proved to fix the issue, we should ensure we always create a new `withdrawalCredentials` by enforcing the use of `Uint8Array.slice()`, just in case backed data is a Buffer - the similar "Invalid state root" was found in the past due to this code place, as noted in the comment - this pattern was used in a lot of places anyway **Update** just found this ```typescript describe("Buffer", () => { it("slice", () => { const buffer = Buffer.alloc(32, 1); const sliced = Uint8Array.prototype.slice.call(buffer, 0, buffer.length); sliced[0] = 2; expect(sliced[0]).toBe(2); expect(buffer[0]).toBe(1); expect(sliced instanceof Buffer).toBe(false); }); }); ``` ``` - Expected + Received - false + true ``` even we used this pattern a lot `Uint8Array.prototype.slice.call` in ssz to deserialize state it still return a Buffer when we deserialize state from leveldb, the state bytes there is really the Buffer that's one possibilities how this issue happened **Conclusion** The state root mismatch happens because the proposer calls `stateTransition` twice for the same block, first time when [computeNewStateRoot](https://github.com/ChainSafe/lodestar/blob/9a2cf748d3a2d63180fdfca6a948731e976b75d8/packages/beacon-node/src/chain/chain.ts#L726) is called and second time when processing / importing the block when it is publishing. Based on these observations it seems like the condition is that - lodestar needs to be proposer of block - the block needs to contain consolidation request switching validator to compounding - the validator being switched needs to be part of state that was loaded from the db / genesis ssz file Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## stable #7493 +/- ##
==========================================
- Coverage 50.51% 50.44% -0.07%
==========================================
Files 602 602
Lines 40583 40587 +4
Branches 2229 2227 -2
==========================================
- Hits 20500 20474 -26
- Misses 20044 20073 +29
- Partials 39 40 +1 |
Performance Report✔️ no performance regression detected Full benchmark results
|
philknows
approved these changes
Feb 24, 2025
🎉 This PR is included in v1.27.1 🎉 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Supersedes #7492. This release fixes bug found on Gnosis via #7478 and also includes Chiado fork params via #7489