Implement BEP-592: Non-Consensus Based Block-Level Access List#3334
Merged
zzzckck merged 31 commits intobnb-chain:feature_balfrom Sep 23, 2025
Merged
Implement BEP-592: Non-Consensus Based Block-Level Access List#3334zzzckck merged 31 commits intobnb-chain:feature_balfrom
zzzckck merged 31 commits intobnb-chain:feature_balfrom
Conversation
52c6fac to
3b0c13a
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements BEP-592: Non-Consensus Based Block-Level Access List to improve block execution performance. The implementation introduces a block access list (BAL) feature that tracks account and storage access during transaction execution, enabling efficient prefetching of state data.
Key changes include:
- Implementation of BAL data structures for generation, propagation, and usage phases
- P2P protocol enhancements (BSC/3) to support BAL transmission between peers
- Integration with mining, state management, and prefetching systems
Reviewed Changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| core/types/block.go | Adds BAL data structures and methods for block access list handling |
| core/state/statedb.go | Implements BAL recording during state access and prefetch functionality |
| core/state_prefetcher.go | Adds BAL-based prefetching logic for snapshot and trie caches |
| eth/protocols/eth/protocol.go | Updates NewBlockPacket to include optional BAL field |
| eth/protocols/bsc/protocol.go | Adds BSC/3 protocol version and BAL support in BlockData |
| core/rawdb/accessors_chain.go | Implements BAL storage and retrieval functions |
| consensus/parlia/parlia.go | Adds BAL signing and verification methods |
| node/config.go | Adds EnableBAL configuration option |
| miner/worker.go | Integrates BAL generation during block creation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
b25c8cf to
329fc73
Compare
d314b7b to
8efaaaa
Compare
buddh0
reviewed
Sep 11, 2025
buddh0
approved these changes
Sep 12, 2025
buddh0
reviewed
Sep 15, 2025
buddh0
reviewed
Sep 15, 2025
f0757c6 to
2e37b3d
Compare
add strict check about the BAL's validity to avoid maliciously constructed block and bal
for release of patch version >= 100, it is a feature release
68f6874 to
e2644dd
Compare
This file contains hidden or 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
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.
Description
This PR implements BEP-592: Non-Consensus Based Block-Level Access List to improve block execution performance. The implementation introduces a block access list (BAL) feature that tracks account and storage access during transaction execution, enabling efficient prefetching of state data.
Key changes include:
1.About Code
a.BAL lifecycle
Each BAL will mainly have three stages: Generation, Propagation and Prefetch. Each stage would have a data structure to represent.
BAL will be encoded before propagation, it is represented by BlockAccessListEncode
Current BAL is mainly used during prefetch, so the data structure would be:
b.BAL Prune
In order to avoid adding extra complexity to the current freezer module, BAL will only be kept in KVDB, but only for the recent
FullImmutabilityThreshold(360_000)blocks, elder BAL will be deleted.c.BSC/3 P2P protocol
BSC/3 would be used to indicate the BAL capability of the remote peer, only peer with bsc/3 protocol will be able to handle BAL data.
2.Try It:
Currently, validator is the only producer of BAL, so validator needs to be upgraded first, then the connected full node can get the BAL data and use it to accelerate it syncing performance.
Enable BAL both on validator and connected full nodes, it can be done by running with flag
--enablebal, or update the config.toml: