Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test 🧪: add accessList gas cost tests #3134

Merged
merged 10 commits into from
Feb 4, 2025
Merged

Conversation

pLabarta
Copy link
Contributor

@pLabarta pLabarta commented Jan 16, 2025

What does it do?

This PR adds test for 3 cases related to the accessList transaction field introduced in EIP-2930 and implemented through the evm pallet in order to confirm that the field does not present an attack vector for Moonbeam networks. In Moonbeam tho, behavior is somewhat different from the expected for the first 4 addresses and storage keys added to the access list of a transaction; costing less than expected.

Cases are the following:

  • Transactions with big access lists should not be gossiped if they exceed the block gas limit
  • After the 4th one, additional addresses should cost 2400 gas (exact value declared in the EIP)
  • After the 4th one, additional storage keys should cost 1900 gas (exact value declared in the EIP)

Is there something left for follow-up PRs?

While working on these tests it was detected that transactions using the accessList field cost more gas that those without it, even when reusing the same storage and addresses multiple times. This means the feature does not work as expected as it is meant to allow users to save some gas by pre-warming the storage they will access.

@pLabarta pLabarta added B0-silent Changes should not be mentioned in any release notes D2-notlive PR doesn't change runtime code (so can't be audited) labels Jan 16, 2025
Copy link
Contributor

github-actions bot commented Jan 16, 2025

WASM runtime size check:

Compared to target branch

Moonbase runtime: 2420 KB (no changes) 🚨

Moonbeam runtime: 2404 KB (no changes) 🚨

Moonriver runtime: 2392 KB (no changes) ✅

Compared to latest release (runtime-3401)

Moonbase runtime: 2420 KB (+388 KB compared to latest release) 🚨

Moonbeam runtime: 2404 KB (+392 KB compared to latest release) 🚨

Moonriver runtime: 2392 KB (+380 KB compared to latest release) ⚠️

Copy link
Contributor

github-actions bot commented Jan 16, 2025

Coverage Report

@@                    Coverage Diff                    @@
##           master   pablo/access-list-test     +/-   ##
=========================================================
  Coverage   74.59%                   74.59%   0.00%     
  Files         380                      380             
  Lines       96029                    96029             
=========================================================
  Hits        71632                    71632             
  Misses      24397                    24397             
Files Changed Coverage

Coverage generated Tue Feb 4 15:34:31 UTC 2025

@pLabarta pLabarta marked this pull request as ready for review January 17, 2025 14:02
@pLabarta pLabarta requested review from a team, stiiifff, TarekkMA and RomarQ January 17, 2025 14:11
TarekkMA
TarekkMA previously approved these changes Jan 17, 2025
Copy link
Contributor

@TarekkMA TarekkMA left a comment

Choose a reason for hiding this comment

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

LGTM, just few nits

@pLabarta pLabarta requested a review from TarekkMA January 21, 2025 19:00
@pLabarta pLabarta merged commit 489a55d into master Feb 4, 2025
37 checks passed
@pLabarta pLabarta deleted the pablo/access-list-test branch February 4, 2025 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B0-silent Changes should not be mentioned in any release notes D2-notlive PR doesn't change runtime code (so can't be audited)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants