-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Update EIP-2935: Move to Draft #8166
Conversation
✅ All reviewers have approved. |
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 pending previous authors' approval
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.
Great updates, I left some comments
Co-authored-by: Jochem Brouwer <[email protected]>
The commit 8e4a928 (as a parent of b82ee83) contains errors. |
…add eip 158 handling strategy (#3) * Update the eip to store in ring buffer instead of serial storage and add eip 158 handling strategy * address feedback * typo * more typos * fix a reference * further cleanup * apply feedback * apply feedback * fix typo
EIPS/eip-2935.md
Outdated
|
||
## Specification | ||
|
||
| Parameter | Value | | ||
| - | - | | ||
| `FORK_BLKNUM` | TBD | | ||
| `FORK_TIMESTAMP` | TBD | | ||
| `HISTORY_STORAGE_ADDRESS` | `0xfffffffffffffffffffffffffffffffffffffffe`| |
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.
This conflicts with the system address from EIP-4788.
if block.parent.timestamp < FORK_TIMESTAMP: | ||
ancestor = block.parent | ||
for i in range(HISTORY_SERVE_WINDOW - 1): | ||
# stop at genesis block |
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.
The wording here is confusing, I suggest the following:
# stop at genesis block | |
# if ancestor.number == 0, this means we inserted the | |
# genesis block hash in the previous iteration. Stop here. |
ancestor = ancestor.parent | ||
state.insert_slot(HISTORY_STORAGE_ADDRESS, ancestor.number % HISTORY_SERVE_WINDOW, ancestor.hash) |
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.
ancestor = ancestor.parent | |
state.insert_slot(HISTORY_STORAGE_ADDRESS, ancestor.number % HISTORY_SERVE_WINDOW, ancestor.hash) | |
state.insert_slot(HISTORY_STORAGE_ADDRESS, (ancestor.number - 1) % HISTORY_SERVE_WINDOW, ancestor.parent.hash) | |
ancestor = ancestor.parent |
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.
this makes it look more analogous to L41
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.
actually, I think we should just rewrite it more clearly:
for i in range(block.number-1, min(block.number-HISTORY_SERVE_WINDOW, 0), -1):
state.insert_slot(HISTORY_STORAGE_ADDRESS, i % HISTORY_SERVE_WINDOW, ancestor.parent.hash)
ancestor = ancestor.parent
then, the way it's implemented is left to the implementer.
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 is not correct : storing ancestor's parent at i
since 'i` is ancestor as per the logic
or we shouldn't use i, just ancestor.number -1
since that relationship is more clear (we always store ancestor's parent)
state.insert_slot(HISTORY_STORAGE_ADDRESS, (ancestor.number -1) % HISTORY_SERVE_WINDOW, ancestor.parent.hash)
…ional sload gas (#4) * extend history retention to 8192 and modify blockhash to charge additional sload gas * title * fix cleanup * add missing contributor names Co-authored-by: Ignacio Hagopian <[email protected]> * further update on discussion * update * update * update * add contract assembley * apply feedback * add helpful comments * fix the comment vals * update the assembely as per feedback * improv * add and generate deployment tx, inputdata and sender/contract address --------- Co-authored-by: Guillaume Ballet <[email protected]> Co-authored-by: Ignacio Hagopian <[email protected]>
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.
All Reviewers Have Approved; Performing Automatic Merge...
We already addressed this question during ACD: if anything, the 4788 system should be changed as it unnecessarily adds code chunks to the witness. We do not want to do that, and so the 2935 contract retains its original mode of operation |
This heretofore stagnant eip is now necessary for stateless clients to be able to execute the
BLOCKHASH
opcode. This PR: