Skip to content

Commit 3ee6639

Browse files
committed
update according to reviews
1 parent ff3da9a commit 3ee6639

File tree

4 files changed

+15
-24
lines changed

4 files changed

+15
-24
lines changed

common/types/message/message.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ func (e *Byte48) UnmarshalJSON(input []byte) error {
9494
type BatchTaskDetail struct {
9595
Version uint8 `json:"version"`
9696
// use one of the string of "euclidv1" / "euclidv2"
97-
ForkName string `json:"fork_name"`
98-
// ChunkInfos []*ChunkInfo `json:"chunk_infos"`
97+
ForkName string `json:"fork_name"`
9998
ChunkProofs []*OpenVMChunkProof `json:"chunk_proofs"`
10099
BatchHeader interface{} `json:"batch_header"`
101100
BlobBytes []byte `json:"blob_bytes"`

coordinator/internal/logic/provertask/batch_prover_task.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -264,22 +264,6 @@ func (bp *BatchProverTask) formatProverTask(ctx context.Context, task *orm.Prove
264264
return nil, fmt.Errorf("Chunk.GetProofsByBatchHash unmarshal proof error: %w, batch hash: %v, chunk hash: %v", encodeErr, task.TaskID, chunk.Hash)
265265
}
266266
chunkProofs = append(chunkProofs, &proof)
267-
268-
// chunkInfo := message.ChunkInfo{
269-
// ChainID: bp.cfg.L2.ChainID,
270-
// PrevStateRoot: common.HexToHash(chunk.ParentChunkStateRoot),
271-
// PostStateRoot: common.HexToHash(chunk.StateRoot),
272-
// WithdrawRoot: common.HexToHash(chunk.WithdrawRoot),
273-
// DataHash: common.HexToHash(chunk.Hash),
274-
// PrevMsgQueueHash: common.HexToHash(chunk.PrevL1MessageQueueHash),
275-
// PostMsgQueueHash: common.HexToHash(chunk.PostL1MessageQueueHash),
276-
// IsPadding: false,
277-
// InitialBlockNumber: proof.MetaData.ChunkInfo.InitialBlockNumber,
278-
// BlockCtxs: proof.MetaData.ChunkInfo.BlockCtxs,
279-
// TxDataLength: proof.MetaData.ChunkInfo.TxDataLength,
280-
// EncryptionKey: proof.MetaData.ChunkInfo.EncryptionKey,
281-
// }
282-
// chunkInfos = append(chunkInfos, &chunkInfo)
283267
}
284268

285269
taskDetail, err := bp.getBatchTaskDetail(batch, chunkProofs, hardForkName)

crates/libzkp/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ pub(crate) fn witness_use_legacy_mode() -> bool {
1818
unsafe { LEGACY_WITNESS_ENCODING }
1919
}
2020

21-
pub const VALIDIUM_VERSION: u8 = 0b01000001;
22-
2321
pub fn set_dynamic_feature(feats: &str) {
2422
for feat_s in feats.split(':') {
2523
match feat_s.trim().to_lowercase().as_str() {

crates/libzkp/src/tasks/batch.rs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ pub enum BatchHeaderV {
3838
V7_8(BatchHeaderV7),
3939
}
4040

41+
impl core::fmt::Display for BatchHeaderV {
42+
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
43+
match self {
44+
BatchHeaderV::V6(_) => write!(f, "V6"),
45+
BatchHeaderV::V7_8(_) => write!(f, "V7_8"),
46+
BatchHeaderV::Validium(_) => write!(f, "Validium"),
47+
}
48+
}
49+
}
50+
4151
impl BatchHeaderV {
4252
pub fn batch_hash(&self) -> B256 {
4353
match self {
@@ -50,28 +60,28 @@ impl BatchHeaderV {
5060
pub fn must_v6_header(&self) -> &BatchHeaderV6 {
5161
match self {
5262
BatchHeaderV::V6(h) => h,
53-
_ => panic!("try to pick other header type"),
63+
_ => unreachable!("A header of {} is considered to be v6", self),
5464
}
5565
}
5666

5767
pub fn must_v7_header(&self) -> &BatchHeaderV7 {
5868
match self {
5969
BatchHeaderV::V7_8(h) => h,
60-
_ => panic!("try to pick other header type"),
70+
_ => unreachable!("A header of {} is considered to be v7", self),
6171
}
6272
}
6373

6474
pub fn must_v8_header(&self) -> &BatchHeaderV8 {
6575
match self {
6676
BatchHeaderV::V7_8(h) => h,
67-
_ => panic!("try to pick other header type"),
77+
_ => unreachable!("A header of {} is considered to be v8", self),
6878
}
6979
}
7080

7181
pub fn must_validium_header(&self) -> &BatchHeaderValidium {
7282
match self {
7383
BatchHeaderV::Validium(h) => &h.header,
74-
_ => panic!("try to pick other header type"),
84+
_ => unreachable!("A header of {} is considered to be validium", self),
7585
}
7686
}
7787
}

0 commit comments

Comments
 (0)