@@ -39,10 +39,12 @@ const (
3939
4040// ChunkTaskDetail is a type containing ChunkTask detail for chunk task.
4141type ChunkTaskDetail struct {
42+ Version uint8 `json:"version"`
4243 // use one of the string of "euclidv1" / "euclidv2"
4344 ForkName string `json:"fork_name"`
4445 BlockHashes []common.Hash `json:"block_hashes"`
4546 PrevMsgQueueHash common.Hash `json:"prev_msg_queue_hash"`
47+ PostMsgQueueHash common.Hash `json:"post_msg_queue_hash"`
4648}
4749
4850// it is a hex encoded big with fixed length on 48 bytes
@@ -90,40 +92,59 @@ func (e *Byte48) UnmarshalJSON(input []byte) error {
9092
9193// BatchTaskDetail is a type containing BatchTask detail.
9294type BatchTaskDetail struct {
95+ Version uint8 `json:"version"`
9396 // use one of the string of "euclidv1" / "euclidv2"
94- ForkName string `json:"fork_name"`
95- ChunkInfos []* ChunkInfo `json:"chunk_infos "`
96- ChunkProofs [] * OpenVMChunkProof `json:"chunk_proofs "`
97- BatchHeader interface {} `json:"batch_header "`
98- BlobBytes [] byte `json:"blob_bytes "`
99- KzgProof Byte48 `json:"kzg_proof ,omitempty"`
100- KzgCommitment Byte48 `json:"kzg_commitment,omitempty"`
101- ChallengeDigest common. Hash `json:"challenge_digest,omitempty"`
97+ ForkName string `json:"fork_name"`
98+ ChunkProofs []* OpenVMChunkProof `json:"chunk_proofs "`
99+ BatchHeader interface {} `json:"batch_header "`
100+ BlobBytes [] byte `json:"blob_bytes "`
101+ KzgProof * Byte48 `json:"kzg_proof,omitempty "`
102+ KzgCommitment * Byte48 `json:"kzg_commitment ,omitempty"`
103+ // ChallengeDigest should be a common.Hash type if it is not nil
104+ ChallengeDigest interface {} `json:"challenge_digest,omitempty"`
102105}
103106
104107// BundleTaskDetail consists of all the information required to describe the task to generate a proof for a bundle of batches.
105108type BundleTaskDetail struct {
109+ Version uint8 `json:"version"`
106110 // use one of the string of "euclidv1" / "euclidv2"
107111 ForkName string `json:"fork_name"`
108112 BatchProofs []* OpenVMBatchProof `json:"batch_proofs"`
109113 BundleInfo * OpenVMBundleInfo `json:"bundle_info,omitempty"`
110114}
111115
116+ type RawBytes []byte
117+
118+ func (r RawBytes ) MarshalJSON () ([]byte , error ) {
119+ if r == nil {
120+ return []byte ("null" ), nil
121+ }
122+ // Marshal the []byte as a JSON array of numbers
123+ rn := make ([]uint16 , len (r ))
124+ for i := range r {
125+ rn [i ] = uint16 (r [i ])
126+ }
127+ return json .Marshal (rn )
128+ }
129+
112130// ChunkInfo is for calculating pi_hash for chunk
113131type ChunkInfo struct {
114- ChainID uint64 `json:"chain_id"`
115- PrevStateRoot common.Hash `json:"prev_state_root"`
116- PostStateRoot common.Hash `json:"post_state_root"`
117- WithdrawRoot common.Hash `json:"withdraw_root"`
118- DataHash common.Hash `json:"data_hash"`
119- IsPadding bool `json:"is_padding"`
120- TxBytes []byte `json:"tx_bytes"`
132+ ChainID uint64 `json:"chain_id"`
133+ PrevStateRoot common.Hash `json:"prev_state_root"`
134+ PostStateRoot common.Hash `json:"post_state_root"`
135+ WithdrawRoot common.Hash `json:"withdraw_root"`
136+ DataHash common.Hash `json:"data_hash"`
137+ IsPadding bool `json:"is_padding"`
138+ // TxBytes []byte `json:"tx_bytes"`
121139 TxBytesHash common.Hash `json:"tx_data_digest"`
122140 PrevMsgQueueHash common.Hash `json:"prev_msg_queue_hash"`
123141 PostMsgQueueHash common.Hash `json:"post_msg_queue_hash"`
124142 TxDataLength uint64 `json:"tx_data_length"`
125143 InitialBlockNumber uint64 `json:"initial_block_number"`
126144 BlockCtxs []BlockContextV2 `json:"block_ctxs"`
145+ PrevBlockhash common.Hash `json:"prev_blockhash"`
146+ PostBlockhash common.Hash `json:"post_blockhash"`
147+ EncryptionKey RawBytes `json:"encryption_key"`
127148}
128149
129150// BlockContextV2 is the block context for euclid v2
@@ -186,6 +207,7 @@ type OpenVMBatchInfo struct {
186207 ChainID uint64 `json:"chain_id"`
187208 PrevMsgQueueHash common.Hash `json:"prev_msg_queue_hash"`
188209 PostMsgQueueHash common.Hash `json:"post_msg_queue_hash"`
210+ EncryptionKey RawBytes `json:"encryption_key"`
189211}
190212
191213// BatchProof includes the proof info that are required for batch verification and rollup.
@@ -246,6 +268,7 @@ type OpenVMBundleInfo struct {
246268 PrevBatchHash common.Hash `json:"prev_batch_hash"`
247269 BatchHash common.Hash `json:"batch_hash"`
248270 MsgQueueHash common.Hash `json:"msg_queue_hash"`
271+ EncryptionKey RawBytes `json:"encryption_key"`
249272}
250273
251274// OpenVMBundleProof includes the proof info that are required for verification of a bundle of batch proofs.
0 commit comments