-
Notifications
You must be signed in to change notification settings - Fork 348
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
base: master
Are you sure you want to change the base?
Conversation
WASM runtime size check:Compared to target branchMoonbase runtime: 2288 KB (no changes) ✅ Moonbeam runtime: 2256 KB (no changes) ✅ Moonriver runtime: 2256 KB (no changes) ✅ Compared to latest release (runtime-3401)Moonbase runtime: 2288 KB (+256 KB compared to latest release) Moonbeam runtime: 2256 KB (+244 KB compared to latest release) Moonriver runtime: 2256 KB (+244 KB compared to latest release) |
Coverage Report@@ Coverage Diff @@
## master pablo/access-list-test +/- ##
==========================================================
- Coverage 74.58% 74.47% -0.11%
Files 377 377
- Lines 96042 95720 -322
==========================================================
- Hits 71632 71283 -349
+ Misses 24410 24437 +27
|
There was a problem hiding this 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
test/suites/dev/moonbase/test-eth-tx/test-eth-tx-access-list.ts
Outdated
Show resolved
Hide resolved
test/suites/dev/moonbase/test-eth-tx/test-eth-tx-access-list.ts
Outdated
Show resolved
Hide resolved
pragma solidity ^0.8.0; | ||
|
||
contract AccessListHelper { | ||
uint256 private storedValue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be a mapping, accessing the same value multiple times is not useful for checking the AccessList usage. The value is considered warm
after the first read, and subsequent reads should be cheaper.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was mostly for testing if warm
storage was cheaper after X subsequent reads when using an access list or not (they did not prove to be cheaper than a TX without the access list field).
For the current tests, I don't this it is necessary to have a mapping unless you think we should add some other scenario.
What does it do?
This PR adds test for 3 cases related to the
accessList
transaction field introduced in EIP-2930 and implemented through theevm
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:
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.