-
Notifications
You must be signed in to change notification settings - Fork 23
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
feat: enforced messages and enforces messages #61
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -138,19 +138,6 @@ interface IScrollChain { | |||||
* Public Mutating Functions * | ||||||
*****************************/ | ||||||
|
||||||
/// @notice Commit a batch of transactions on layer 1. | ||||||
/// | ||||||
/// @param version The version of current batch. | ||||||
/// @param parentBatchHeader The header of parent batch, see the comments of `BatchHeaderV0Codec`. | ||||||
/// @param chunks The list of encoded chunks, see the comments of `ChunkCodec`. | ||||||
/// @param skippedL1MessageBitmap The bitmap indicates whether each L1 message is skipped or not. | ||||||
function commitBatch( | ||||||
uint8 version, | ||||||
bytes calldata parentBatchHeader, | ||||||
bytes[] memory chunks, | ||||||
bytes calldata skippedL1MessageBitmap | ||||||
) external; | ||||||
|
||||||
/// @notice Commit a batch of transactions on layer 1 with blob data proof. | ||||||
/// | ||||||
/// @dev Memory layout of `blobDataProof`: | ||||||
|
@@ -171,40 +158,28 @@ interface IScrollChain { | |||||
bytes calldata blobDataProof | ||||||
) external; | ||||||
|
||||||
/// @notice Revert pending batches. | ||||||
/// @dev one can only revert unfinalized batches. | ||||||
/// @param firstBatchHeader The header of first batch to revert, see the encoding in comments of `commitBatch`. | ||||||
/// @param lastBatchHeader The header of last batch to revert, see the encoding in comments of `commitBatch`. | ||||||
function revertBatch(bytes calldata firstBatchHeader, bytes calldata lastBatchHeader) external; | ||||||
|
||||||
/* This function will never be used since we already upgrade to Darwin. We comment out the codes for reference. | ||||||
/// @notice Finalize a committed batch (with blob) on layer 1. | ||||||
/// @notice Commit a batch of transactions on layer 1 with blob data proof. | ||||||
/// | ||||||
/// @dev Memory layout of `blobDataProof`: | ||||||
/// | z | y | kzg_commitment | kzg_proof | | ||||||
/// |---------|---------|----------------|-----------| | ||||||
/// | bytes32 | bytes32 | bytes48 | bytes48 | | ||||||
/// | ||||||
/// @param batchHeader The header of current batch, see the encoding in comments of `commitBatch. | ||||||
/// @param prevStateRoot The state root of parent batch. | ||||||
/// @param postStateRoot The state root of current batch. | ||||||
/// @param withdrawRoot The withdraw trie root of current batch. | ||||||
/// @param version The version of current batch. | ||||||
/// @param parentBatchHeader The header of parent batch, see the comments of `BatchHeaderV0Codec`. | ||||||
/// @param chunks The list of encoded chunks, see the comments of `ChunkCodec`. | ||||||
/// @param blobDataProof The proof for blob data. | ||||||
/// @param aggrProof The aggregation proof for current batch. | ||||||
function finalizeBatchWithProof4844( | ||||||
bytes calldata batchHeader, | ||||||
bytes32 prevStateRoot, | ||||||
bytes32 postStateRoot, | ||||||
bytes32 withdrawRoot, | ||||||
bytes calldata blobDataProof, | ||||||
bytes calldata aggrProof | ||||||
function commitBatchWithBlobProof( | ||||||
uint8 version, | ||||||
bytes calldata parentBatchHeader, | ||||||
bytes[] memory chunks, | ||||||
bytes calldata blobDataProof | ||||||
) external; | ||||||
*/ | ||||||
|
||||||
/// @notice Finalize a list of committed batches (i.e. bundle) on layer 1. | ||||||
/// @param batchHeader The header of last batch in current bundle, see the encoding in comments of `commitBatch`. | ||||||
/// @param postStateRoot The state root after current bundle. | ||||||
/// @param withdrawRoot The withdraw trie root after current batch. | ||||||
/// @param withdrawRoot The withdraw trie root after current bundle. | ||||||
/// @param aggrProof The aggregation proof for current bundle. | ||||||
function finalizeBundleWithProof( | ||||||
bytes calldata batchHeader, | ||||||
|
@@ -216,12 +191,44 @@ interface IScrollChain { | |||||
/// @notice Finalize a list of committed batches (i.e. bundle) on layer 1 with TEE proof. | ||||||
/// @param batchHeader The header of last batch in current bundle, see the encoding in comments of `commitBatch`. | ||||||
/// @param postStateRoot The state root after current bundle. | ||||||
/// @param withdrawRoot The withdraw trie root after current batch. | ||||||
/// @param withdrawRoot The withdraw trie root after current bundle. | ||||||
/// @param teeProof The tee proof for current bundle. | ||||||
function finalizeBundleWithTeeProof( | ||||||
bytes calldata batchHeader, | ||||||
bytes32 postStateRoot, | ||||||
bytes32 withdrawRoot, | ||||||
bytes calldata teeProof | ||||||
) external; | ||||||
|
||||||
/// @param The struct for batch committing. | ||||||
/// @param version The version of current batch. | ||||||
/// @param parentBatchHeader The header of parent batch, see the comments of `BatchHeaderV0Codec`. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
/// @param chunks The list of encoded chunks, see the comments of `ChunkCodec`. | ||||||
/// @param blobDataProof The proof for blob data. | ||||||
struct CommitStruct { | ||||||
uint8 version; | ||||||
bytes parentBatchHeader; | ||||||
bytes[] chunks; | ||||||
bytes blobDataProof; | ||||||
} | ||||||
|
||||||
/// @param The struct for batch finalization. | ||||||
/// @param batchHeader The header of current batch, see the encoding in comments of `commitBatch`. | ||||||
/// @param postStateRoot The state root after current batch. | ||||||
/// @param withdrawRoot The withdraw trie root after current batch. | ||||||
/// @param zkProof The zk proof for current batch (single-batch bundle). | ||||||
/// @param teeProof The tee proof for current batch (single-batch bundle). | ||||||
struct FinalizeStruct { | ||||||
bytes batchHeader; | ||||||
bytes32 postStateRoot; | ||||||
bytes32 withdrawRoot; | ||||||
bytes zkProof; | ||||||
bytes teeProof; | ||||||
} | ||||||
|
||||||
/// @notice Commit a batch of transactions on layer 1 with blob data proof and finalize it. | ||||||
/// @param commitStruct The data needed for commit. | ||||||
/// @param finalizeStruct The data needed for finalize. | ||||||
function commitAndFinalizeBatch(CommitStruct calldata commitStruct, FinalizeStruct calldata finalizeStruct) | ||||||
external; | ||||||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.