Skip to content

Comments

feat(gas): add tx_access_list_cost helper to GasParams#3349

Merged
rakita merged 1 commit intobluealloy:mainfrom
saylor-mik87786:feat/gas-params-access-list-helper
Jan 26, 2026
Merged

feat(gas): add tx_access_list_cost helper to GasParams#3349
rakita merged 1 commit intobluealloy:mainfrom
saylor-mik87786:feat/gas-params-access-list-helper

Conversation

@saylor-mik87786
Copy link
Contributor

Closes #3343

Add a helper method to calculate the total gas cost for an access list. This simplifies the calculation by combining address and storage key costs in one call instead of manually multiplying and adding them separately.

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 26, 2026

Merging this PR will not alter performance

✅ 173 untouched benchmarks


Comparing saylor-mik87786:feat/gas-params-access-list-helper (40edcf5) with main (0dc217a)

Open in CodSpeed

)
}

/// Returns true if the opcode accesses storage (persistent or transient).
Copy link
Member

Choose a reason for hiding this comment

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

Would remove this change from the PR

/// assert_eq!(cost, 2 * 2400 + 5 * 1900); // 2 * ACCESS_LIST_ADDRESS + 5 * ACCESS_LIST_STORAGE_KEY
/// ```
#[inline]
pub fn tx_access_list_cost(&self, accounts: u64, storages: u64) -> u64 {
Copy link
Member

Choose a reason for hiding this comment

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

Makes sense, and lgtm

@saylor-mik87786 saylor-mik87786 force-pushed the feat/gas-params-access-list-helper branch from 7ccd046 to 40edcf5 Compare January 26, 2026 14:42
@saylor-mik87786
Copy link
Contributor Author

@rakita Updated, sir.

@rakita rakita merged commit 70f6f78 into bluealloy:main Jan 26, 2026
31 checks passed
@github-actions github-actions bot mentioned this pull request Jan 26, 2026
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.

GasParams helper for access list

2 participants