Update EIP-4788: post audit tweaks#7672
Conversation
|
✅ All reviewers have approved. |
EIPS/eip-4788.md
Outdated
| "r": "0x539", | ||
| "s": "0x133700f3a77843802897db", | ||
| "hash": "0x14789a20c0508b81ab7a0287a12a3a41ca960aa18244af8e98689e37ed569f07" | ||
| "s": "0x133700018971c643803096", |
There was a problem hiding this comment.
Do the r and s values have any particular meaning? I'm more curious as to why they s value had to change. Was it searched to find the first valid signature of any address from "zero" or is there some other meaning?
There was a problem hiding this comment.
The s value is like the "nonce" for our address generator. We keep trying new s values until we get a deploy address with beac02 prefix.
There was a problem hiding this comment.
Got it.
Is there a canonical definition of what a synthetic address is and best practices to grind out and S value?
In this particular case (r being 1337 in decimal, and s being 0x1337 left shifted 72 bytes, and then search upwards from there) it is obvious it should not have a known public key. But I think the industry would benefit from a best practice for showing a transaction is a synthetic address transaction with a know r producing a corresponding s.
There was a problem hiding this comment.
I think this post is the pinnacle of our knowledge on the subject and it does not give any explicit instructions: https://weka.medium.com/how-to-send-ether-to-11-440-people-187e332566b7
There was a problem hiding this comment.
Are you talking about Nothing-up-my-sleeve numbers?
|
Not sure I understand this, but I created my own gist to compare: https://gist.github.com/adietrichs/4f41090c37d292a96b08c8cdbd076d90 For many slot times, |
|
I talked with @lightclient, and out of that came the idea to maybe go the other way: I updated the gist with a third option of a modulus of |
|
I have opened the PR: lightclient#7.
This PR changes the modulus to a prime number, so that there can never be any shared factors with the slot time. This way, 100% of the history region will be utilized, allowing for simple reasoning about total storage requirements and the total history depth, even in the case of future slot time changes. The specific value ( |
Update EIP-4788: Move to Prime Modulus
|
New beacon root address found by @spencer-tb! Thanks! |
Upgrade execution-spec-tests to [v1.0.4](https://github.com/ethereum/execution-spec-tests/releases/tag/v1.0.4). Set BeaconRootsAddress to `0xbEAC020008aFF7331c0A389CB2AAb67597567d7a` in preparation for [dencun-devnet-9](https://notes.ethereum.org/@ethpandaops/dencun-devnet-9) per ethereum/EIPs#7672.
|
Final beacon root address is |
eth-bot
left a comment
There was a problem hiding this comment.
All Reviewers Have Approved; Performing Automatic Merge...
Set BeaconRootsAddress to `0x000F3df6D732807Ef1319fB7B8bB8522d0Beac02` in preparation for [dencun-devnet-9](https://notes.ethereum.org/@ethpandaops/dencun-devnet-9) per ethereum/EIPs#7672. Hopefully this will be the final change to BeaconRootsAddress. Also update execution-spec-tests to [v1.0.5](https://github.com/ethereum/execution-spec-tests/releases/tag/v1.0.5).
| | `HISTORY_BUFFER_LENGTH` | `8191` | | ||
| | `SYSTEM_ADDRESS` | `0xfffffffffffffffffffffffffffffffffffffffe` | | ||
| | `BEACON_ROOTS_ADDRESS` | `0xbEac00dDB15f3B6d645C48263dC93862413A222D` | | ||
| | `BEACON_ROOTS_ADDRESS` | `0x000F3df6D732807Ef1319fB7B8bB8522d0Beac02` | |
|
|
||
| jumpdest | ||
| push3 0x018000 | ||
| push3 0x001fff |
There was a problem hiding this comment.
yeah, this was a miss. However, not worth fixing, the runtime execution gascost is identical, the only difference is that the code is one byte larger than it would have needed to be.
There was a problem hiding this comment.
This repeats 4x so 4 bytes wasted. Forever :)
There was a problem hiding this comment.
Yeah. Now there are 32 bits less left in the world.
🚻 ☮️
This change contains the final (?) address for 4788 beacon root contract. The update to the EIP is being tracked here: ethereum/EIPs#7672 --------- Co-authored-by: Martin Holst Swende <martin@swende.se>
This change contains the final (?) address for 4788 beacon root contract. The update to the EIP is being tracked here: ethereum/EIPs#7672 --------- Co-authored-by: Martin Holst Swende <martin@swende.se>
This change contains the final (?) address for 4788 beacon root contract. The update to the EIP is being tracked here: ethereum/EIPs#7672 --------- Co-authored-by: Martin Holst Swende <martin@swende.se>
This change contains the final (?) address for 4788 beacon root contract. The update to the EIP is being tracked here: ethereum/EIPs#7672 --------- Co-authored-by: Martin Holst Swende <martin@swende.se>
repost from lightclient/4788asm#16
We've had a few really nice audits done on this code and things have generally been positive. There are a few pieces of feedback that I think are worth addressing before we settle on the final code though. Here is a list, ordered by priority:
Updateupdated tobuflento93600-- this value will share 500-10001 more remainders if the slot time were to change versus the current modulus, decreasing the overall storage use of the contract (h/t @adietrichs).8191as the number is prime and there is 100% utilization for all potential slot time values.calldatacopya single time, instead of paying for that cost at each load. This require a bit of dup'ing and swap'ing, but still extremely manageable. As a part of this I was also able to delete theget_inputmacro (h/t @adietrichs).Footnotes
https://gist.github.com/lightclient/820a0d5c5861ed09c5cae5e384e9779e ↩