[DO NOT MERGE] [MEL] Changes to OSP contracts - #432
Conversation
| mach.switchCoThreadStacks(); | ||
| } | ||
|
|
||
| function executeGetEndParentChainBlockHash( |
There was a problem hiding this comment.
Shouldn't this talk to the rollup contract to verify the parent assertion of the challenge has the correct parent chain block hash that is claimed in the inputs here?
There was a problem hiding this comment.
Hey @rauljordan , that function is writing the targetParentChainBlockHash available in the ExecutionContext to the Machine. The ExecutionContext is created when calling EdgeChallengeManager.confirmEdgeByOneStepProof(), and it takes the nextParentChainBlockHash from the prevAssertion (here). The prevAssertion is included in the challenge by both contenders, and its config is passed and validated against the on-chain assertion in that same function (so it can be trusted).
Let me know if this answers your question, or if I'm missing something 🙏 .
!! WIP - DO NOT MERGE !!
Note
This is a preliminary version, and can completely change, based on changes in the design or the implementation of the feature in nitro.
This PR builds on top of #427 and contains changes to support MEL in the OSP contracts.
Key changes
nextParentChainBlockHashdefined in the configuration of the previous assertion), and extract all child chain messages (batches and delayed messages) from themMsgCountand one counter for messages that have been executedExecutedMsgCountmaxInboxMessagesReadand thebridgecontract anymore, and instead uses thenextParentChainBlockHash. The GlobalState already contains the MELState hash, which contains the information about the message counters and accumulators.GetEndParentChainBlockHash. Thus, all prior block hashes are provable with their preimages, and all messages contained in those blocks are then legit. OnlyReadPreImageis needed for that. The MELState hash is also included in the GlobalState (provable withGetGlobalStateandSetGlobalState), and any intermediate changes to the MELState are provable by the internal wasm instructions that modify them (which are all included as opcodes in the OSP contracts).Pending work
Nitro reference PRs