Skip to content

feature: non-consensus based block-access-list(EIP-7928)#3413

Merged
zzzckck merged 7 commits intobnb-chain:feature_bal7928from
fynnss:feature/bal_with_post_state_no_consensus
Dec 16, 2025
Merged

feature: non-consensus based block-access-list(EIP-7928)#3413
zzzckck merged 7 commits intobnb-chain:feature_bal7928from
fynnss:feature/bal_with_post_state_no_consensus

Conversation

@fynnss
Copy link
Contributor

@fynnss fynnss commented Oct 21, 2025

Description

This pr impl no consensus based Block-Access-List(EIP-7928).

Cherry-pick from ethereum/go-ethereum#32263 and using the non-consensus method in BEP-592 #3374

Rationale

Deviations from EIP-7928:

  • Consensus-level changes were removed, include BAL hash in block header.
  • BALs now transfer only via the block propagation payload (ETH/BSC P2P messages) to help peers import blocks faster.
  • If the BAL-driven parallel execution path fails (missing data, validation mismatch, etc.), the importer falls back to the legacy serial execution pipeline to guarantee correctness, so enabling BAL never jeopardizes block processing.

Example

Changes

Notable changes:
*

@fynnss fynnss changed the base branch from master to develop October 21, 2025 02:14
@fynnss fynnss force-pushed the feature/bal_with_post_state_no_consensus branch 6 times, most recently from 4a8d81c to 094fe8c Compare October 25, 2025 05:59
@fynnss fynnss marked this pull request as draft October 27, 2025 06:48
@fynnss fynnss changed the title feature: no consensus based Block-Access-List(EIP-7928) feature: no consensus based block-access-list(EIP-7928) Oct 27, 2025
@fynnss fynnss changed the title feature: no consensus based block-access-list(EIP-7928) feature: non-consensus block-access-list(EIP-7928) Oct 27, 2025
@fynnss fynnss force-pushed the feature/bal_with_post_state_no_consensus branch 3 times, most recently from dae1cda to 0201f0e Compare October 29, 2025 07:35
@MatusKysel MatusKysel requested a review from Copilot October 31, 2025 06:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements batch update functionality for trie structures and adds support for Block Access Lists (BAL) in the Amsterdam fork. The changes include:

  • Parallel batch update methods for tries (Merkle Patricia, Secure, Verkle, and Transition tries)
  • Configuration support for BAL feature enablement
  • Test fixtures and comprehensive test coverage for BAL functionality
  • Minor fixes to comment formatting and API signatures

Reviewed Changes

Copilot reviewed 111 out of 140 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
trie/trie.go Adds concurrent batch update method with parallelism optimization
trie/secure_trie.go Implements batch update methods for account and storage updates
trie/verkle.go Adds batch update wrappers for Verkle trie operations
trie/transition.go New transition trie implementation with batch update stubs
trie/dummy_trie.go Adds no-op batch update methods to empty trie
trie/trie_test.go Adds comprehensive batch update tests and fixes comment formatting
tests/state_test_util.go Updates SetCode call to include tracing parameter
tests/init.go Adds Amsterdam fork configuration
tests/gen_btheader.go Adds BlockAccessListHash field to block header
tests/fixtures-amsterdam-bal/* Comprehensive test fixtures for BAL validation
params/config.go Adds EnableBAL flag and BAL-related helper methods
node/config.go Removes EnableBAL from node config (moved to chain config)
miner/miner.go Fixes type assertion for pending state
internal/web3ext/web3ext.go Adds debug RPC methods for BAL inspection
internal/ethapi/simulate.go Updates system contract processing signatures

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fynnss fynnss force-pushed the feature/bal_with_post_state_no_consensus branch from 4999094 to 2fce784 Compare November 3, 2025 02:21
@fynnss fynnss force-pushed the feature/bal_with_post_state_no_consensus branch 2 times, most recently from e3dc9f4 to bcf6d5f Compare November 7, 2025 12:07
@fynnss fynnss marked this pull request as ready for review November 10, 2025 01:47
@bnb-chain bnb-chain deleted a comment from Copilot AI Nov 10, 2025
@bnb-chain bnb-chain deleted a comment from Copilot AI Nov 10, 2025
@bnb-chain bnb-chain deleted a comment from Copilot AI Nov 10, 2025
@bnb-chain bnb-chain deleted a comment from Copilot AI Nov 10, 2025
@bnb-chain bnb-chain deleted a comment from Copilot AI Nov 10, 2025
@bnb-chain bnb-chain deleted a comment from Copilot AI Nov 10, 2025
@bnb-chain bnb-chain deleted a comment from Copilot AI Nov 10, 2025
miner/worker.go Outdated
select {
case block := <-w.resultCh:
// Short circuit when receiving empty result.
// Short circuit when receiving empty result/core/types/block.go./core/types/block.go
Copy link
Contributor

Choose a reason for hiding this comment

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

?? result/core/types/block.go./core/types/block.go

Copy link
Contributor Author

Choose a reason for hiding this comment

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

deleted.

miner/worker.go Outdated
signer types.Signer
state *state.StateDB // apply state changes here
tcount int // count of non-system transactions in cycle
size uint64 // size of the block we are building
Copy link
Contributor

Choose a reason for hiding this comment

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

is it useful?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's useless. I'll remove it.

defer release()

// upgrade built-in system contract before normal txs if Feynman is not enabled
systemcontracts.TryUpdateBuildInSystemContract(api.backend.ChainConfig(), block.Number(), parent.Time(), block.Time(), statedb, true)
Copy link
Contributor

Choose a reason for hiding this comment

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

why change this file? it will break these apis

Copy link
Contributor Author

Choose a reason for hiding this comment

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

merge from upstream. I'll restore these files.

@fynnss fynnss changed the title feature: non-consensus block-access-list(EIP-7928) feature: non-consensus based block-access-list(EIP-7928) Dec 3, 2025
@fynnss fynnss force-pushed the feature/bal_with_post_state_no_consensus branch from 79b5159 to 602e68f Compare December 3, 2025 02:25
)

// LookupInstructionSet returns the instruction set for the fork configured by
// the rules.
Copy link
Contributor

Choose a reason for hiding this comment

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

this file is not right for bsc, skip many hardforks
also not used, so remove it is bettor

Copy link
Contributor Author

Choose a reason for hiding this comment

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

deleted.

)
_, size, _ := s.Kind()
if err := s.Decode(&eb); err != nil {
fmt.Println("error here")
Copy link
Contributor

Choose a reason for hiding this comment

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

'fmt.Println("error here")'
need to be improved

core/types.go Outdated

// ValidateState validates the given statedb and optionally the process result.
ValidateState(block *types.Block, state *state.StateDB, res *ProcessResult, stateless bool) error
ValidateState(block *types.Block, state *state.StateDB, res *ProcessResult, validateState, stateless bool) error
Copy link
Contributor

Choose a reason for hiding this comment

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

define validateState, but never used

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was originally used to control whether or not root hash calculations were performed inside the validatorstate, as they were already processed in calcAndVerifyRoot in the parallel state processor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But anyway, I'll remove it.

@fynnss fynnss force-pushed the feature/bal_with_post_state_no_consensus branch 3 times, most recently from 9991315 to 4dbddfd Compare December 3, 2025 06:26
@fynnss fynnss force-pushed the feature/bal_with_post_state_no_consensus branch 3 times, most recently from 7bf5637 to 0d28ae1 Compare December 8, 2025 09:35
@fynnss fynnss force-pushed the feature/bal_with_post_state_no_consensus branch from 0d28ae1 to a8bdbb0 Compare December 9, 2025 08:35
buddh0
buddh0 previously approved these changes Dec 9, 2025
@buddh0 buddh0 dismissed their stale review December 9, 2025 09:00

confirm whether need to be merged

@zzzckck zzzckck changed the base branch from develop to feature_bal7928 December 9, 2025 10:37
@djs1990
Copy link

djs1990 commented Dec 12, 2025

@zzzckck zzzckck merged commit c7f5aac into bnb-chain:feature_bal7928 Dec 16, 2025
1 check passed
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.

5 participants