Skip to content

fix(provider): default create_access_list to pending#3890

Open
Shresth79 wants to merge 1 commit intoalloy-rs:mainfrom
Shresth79:fix/create-access-list-pending-default
Open

fix(provider): default create_access_list to pending#3890
Shresth79 wants to merge 1 commit intoalloy-rs:mainfrom
Shresth79:fix/create-access-list-pending-default

Conversation

@Shresth79
Copy link
Copy Markdown
Contributor

@Shresth79 Shresth79 commented Apr 15, 2026

Motivation

StorageSlotFinder::find_slot collects candidate slots with eth_createAccessList and then validates them with eth_call. The former defaulted to latest while the latter defaulted to pending, so plain providers could compare two different state contexts and miss the correct slot.

Solution

Default Provider::create_access_list to the pending block so it matches eth_call while still allowing explicit .latest() / .block_id(...) overrides. Clarify the provider docs, add a focused unit test for the new default, and document that StorageSlotFinder follows the provider's default block context.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@Shresth79
Copy link
Copy Markdown
Contributor Author

The new create_access_list regression test passes locally; the remaining failure is test_anvil_set_time, which looks unrelated to this PR.

Comment on lines 248 to +252
fn create_access_list<'a>(
&self,
request: &'a N::TransactionRequest,
) -> RpcWithBlock<&'a N::TransactionRequest, AccessListResult> {
self.client().request("eth_createAccessList", request).into()
RpcWithBlock::new_rpc(self.client().request("eth_createAccessList", request)).pending()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

since this is for accesslist, maybe we should keep this unchanged, but I think pending is actually more correct ehre

Copy link
Copy Markdown
Contributor Author

@Shresth79 Shresth79 Apr 15, 2026

Choose a reason for hiding this comment

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

@mattsse Thanks for the review! I was mainly trying to keep create_access_list in line with call, since
StorageSlotFinder uses both and the differing defaults can cause context drift. If you’d rather keep
the change narrower, I can limit it to the StorageSlotFinder call site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants