-
Notifications
You must be signed in to change notification settings - Fork 99
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
Research Area: Introduce Nonce with each Consensus Influencing Event #330
Comments
TransactionDeposited V2The purpose of the V2 The definition of a event TransactionDeposited(address indexed from, address indexed to, uint256 indexed version, bytes opaqueData); The bytes memory opaqueData = abi.encodePacked(_mint, _value, _gasLimit, _isCreation, _data); For v1, we can add a nonce to bytes memory opaqueData = abi.encodePacked(nonce, _mint, _value, _gasLimit, _isCreation, _data); The Lets say that there were 3 deposits in block 10 with the nonces 5, 6 and 7. To guarantee that we observed all of the deposits in block 10, we would need proofs for deposits with nonces 4, 5, 6, 7 and 8. We would observe that 5-7 are in block 10 and 4 and 8 are not in block 10. If we used a more complicated data structure on chain, it would be possible to relax needing to observe the boundaries. We would need to be careful with edge cases around 0. Note that this can be added to the system without any need for the fault proof programs to instantly upgrade to and adopt, they can adopt it at any time. In the derivation pipeline, we would need to update the parsing of the data here but we could ignore the nonce. It is only useful in the fault proof program, to guarantee that we have observed all deposits. A nice property to observe would be to have a nonce in the |
This would be a great change that would make derivation much cheaper (much smaller witness data from not having to pull in all L1 receipts for every L1 block & also not requiring iteration through all of these receipts). I believe that having the nonce in the |
Updated approach, much more simple. The idea is to add a nonce to the events in a backwards compatible way. Rather than trying to reduce the number of consensus influencing events, we continue to have 2 contracts that both have their own consensus influencing event. We create a unified way of encoding the nonce into the event. event ConfigUpdate(uint256 indexed version, UpdateType indexed updateType, bytes data);
event TransactionDeposited(address indexed from, address indexed to, uint256 indexed version, bytes opaqueData);
These are the definitions of the consensus influencing events. Both of them have a This would mean that both the This would require some small modifications to The |
Edited: This seems super clean and would love to assist with implementing this. Seems like a very small diff that would be a very small change in One thing to note is that when implementing this in a fault proof program, in order to not iterate through all L1 receipts, we have to make sure that at each block boundary, we get the state of the
|
We should consider introducing a nonce with each log that influences consensus. This would allow for an optimization within the proof programs where they no longer need to observe and filter all logs to guarantee that they have the full set of logs. A witness can be used to populate the logs and the program can check that the nonces all line up to guarantee that the complete set of logs are present within the program.
There are currently 2 logs that impact consensus:
TransactionDeposited
from theOptimismPortal
ConfigUpdated
from theSystemConfig
TransactionDeposited
We could have a nonce on L1 and on L2 and keep them up to date, this could be generally useful to know how many deposits have yet to be processed by offchain software. If we want to hold the invariant that$$L1nonce <= L2nonce$$ then we would need to add the number of deposits inbound in the L1 attributes transaction, since there would be a race condition with upgrading the contracts for existing chains if we simply incremented on L2. This would require a new deposit version and the accumulator would in the L1 attributes transaction would only count deposits that are of the new version
ConfigUpdated
I think that these events can be removed completely from consensus given we follow the pattern designed in #122 and a generic form of this
The text was updated successfully, but these errors were encountered: