Skip to content

Conversation

@haardikk21
Copy link
Collaborator

@haardikk21 haardikk21 commented Jan 9, 2026

Alternative implementation for a FBAL Builder instead of #273. Contains all the same test cases (+ improved with having stronger assertions). Retains all the same functionality so far.

Makes it easier to build custom Payload Builders and Block Executors with this pattern rather than the revm inspector approach used previously.

Per the spec, there are some minor bugs that remain to be fixed that were also bugs in the older PR #273. For now, this PR is 1:1 compatible with the older PR. Additional identified bugs will be resolved in a followup.

@haardikk21 haardikk21 requested a review from meyer9 January 9, 2026 08:00
@cb-heimdall
Copy link
Collaborator

cb-heimdall commented Jan 9, 2026

✅ Heimdall Review Status

Requirement Status More Info
Reviews 2/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

Comment on lines +29 to +36
sol!(
#[sol(rpc)]
AccessListContract,
concat!(
env!("CARGO_MANIFEST_DIR"),
"/../test-utils/contracts/out/AccessList.sol/AccessList.json"
)
);
Copy link
Contributor

@refcell refcell Jan 9, 2026

Choose a reason for hiding this comment

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

I'm not sure of the best way to organize this - we should brainstorm a bit - but I don't think it generally makes sense to have individual crates depend on test-utils in any way. If we need to use the accesslist.json here, we should probably localize it and then re-export the type under the test-utils feature flag so the test-utils crate can re-use this type.

Not a blocker for this PR, but worth investigation and coming to a consensus

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

😅 hahah. yeah this repo used to have localized testing setups not too long ago, the test-utils consolidation is fairly recent.

note however the JSON is a build artifact of contracts that live within test-utils. I originally did have contracts at the repo root which tbh i preferred, but those got shifted to the test-utils crate so now we have this situation. I don't think we need to re-export the type in hopes test-utils will ever use it - the dependency relationship is almost always X (depends on) test-utils (for harnesses, fixtures, etc) and very rarely the other way around

Copy link
Contributor

@refcell refcell left a comment

Choose a reason for hiding this comment

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

Looks great!

Copy link
Contributor

@meyer9 meyer9 left a comment

Choose a reason for hiding this comment

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

LGTM! Left a few non-blocking comments.

let account_changes = self.access_list.changes.entry(*address).or_default();

// Update balance, nonce, and code
match self.db.basic(*address)? {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could also check account.is_touched() before running this DB lookup (very small perf optimization)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll try it out.

Per the spec we need to have an entry in AccountChanges even for addresses that were simply loaded/read without having any modifications made (just w/ empty changes though). I'm wondering if there's any case where is_touched is false but we also haven't previously filed an entry for that account via our wrapper around db.basic(...)?

/// Maximum txn index from the full block that's included in this access list
pub max_tx_index: u64,
/// keccak256 hash of the RLP-encoded account changes list
pub fal_hash: B256,
Copy link
Contributor

Choose a reason for hiding this comment

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

I know the original EIP had access list hash stored in the header to ensure the access list was determined by the time the block was built, but I don't necessarily see the point of including the hash here - do you have a specific use case in mind? Can also address in a future PR!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

not as of today, think it's an artifact of having modified the BAL spec. if necessary we can remove this later, but will think about it a bit more


#[test]
/// Tests that a single ETH transfer is included in the access list
fn test_single_transfer() {
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add a test for sending 0 balance? In this case, the receiving account shouldn't be included in the access list since it hasn't changed, but the account will be considered touched.

Copy link
Contributor

Choose a reason for hiding this comment

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

feel free to take or leave since we're not even using account.is_touched right now.

Copy link
Collaborator Author

@haardikk21 haardikk21 Jan 9, 2026

Choose a reason for hiding this comment

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

that's interesting, i'll add it in a followup alongside some other fixes that need to be made

@cb-heimdall
Copy link
Collaborator

Review Error for meyer9 @ 2026-01-09 15:38:44 UTC
User failed mfa authentication, see go/mfa-help

@haardikk21 haardikk21 merged commit 4a25137 into main Jan 9, 2026
19 checks passed
@haardikk21 haardikk21 deleted the fal-builder-db branch January 9, 2026 15:55
danyalprout pushed a commit that referenced this pull request Jan 11, 2026
* Fix builder tx cumulative da

* fix builder gas and da calculation

* add test
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