add SLOAD & SSTORE spec#11
Conversation
| # SLOAD & SSTORE op code | ||
|
|
||
| Disclaimer: this version of the sload/sstore sepc only corresponds to [EIP-2929](https://eips.ethereum.org/EIPS/eip-2929). | ||
|
|
There was a problem hiding this comment.
but does not implement EIP 2930 yet? (if yes, add this into the spec)
There was a problem hiding this comment.
none of 2028, 2930, 1559 is implemented yet. should I add them all?
There was a problem hiding this comment.
in fact. 2930 breaks (improves on) 2029. if 2930 then it can't exactly be 2929
|
great job, i did not realize sstore/sload are so complex... warm code reset refund... One question: there are many branches in the sstore gas cost, while there are only 4 test cases. Will it be better to improve test coverage? |
ok will do |
|
after merging with master, need to fix some conflicts again |
|
@lispc updated |
| - `SSTORE`: +2 | ||
| - gas: | ||
| - `SLOAD`: | ||
| + the accessed address is warm: gas + WARM_STORAGE_READ_COST |
There was a problem hiding this comment.
| + the accessed address is warm: gas + WARM_STORAGE_READ_COST | |
| + the accessed address is warm: + WARM_STORAGE_READ_COST |
I think we only need to mark how much gas needs to add for each step.
There was a problem hiding this comment.
I prefer keeping them as "gas + XXX", so that it's consistent with other markdown files.
| from ..opcode import Opcode | ||
| from ..table import CallContextFieldTag, TxContextFieldTag | ||
|
|
||
| COLD_SLOAD_COST = 2100 |
There was a problem hiding this comment.
move all the gas constants into a single file?
There was a problem hiding this comment.
I try moving to "src/zkevm_specs/params.py" and use
from ......params import (
COLD_SLOAD_COST,
WARM_STORAGE_READ_COST,
SLOAD_GAS,
SSTORE_SET_GAS,
SSTORE_RESET_GAS,
SSTORE_CLEARS_SCHEDULE,
)
but didn't make it.
encounter an error with ImportError: attempted relative import beyond top-level package
so I just put it as "src/zkevm_specs/evm/execution/params.py". see 9d7c63b
No description provided.