From 5c6d0fef3ec63ae93065888d0d909a4cd9d3bd34 Mon Sep 17 00:00:00 2001 From: David Date: Sat, 10 Feb 2024 11:00:44 +0800 Subject: [PATCH] feat: fix lint errors --- driver/chain_syncer/calldata/syncer.go | 1 + driver/txlist_fetcher/blob.go | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/driver/chain_syncer/calldata/syncer.go b/driver/chain_syncer/calldata/syncer.go index b5f373721..58434f03e 100644 --- a/driver/chain_syncer/calldata/syncer.go +++ b/driver/chain_syncer/calldata/syncer.go @@ -261,6 +261,7 @@ func (s *Syncer) onBlockProposed( "blockID", event.BlockId, "hint", hint, "invalidTxIndex", invalidTxIndex, + "bytes", len(txListBytes), ) l1Origin := &rawdb.L1Origin{ diff --git a/driver/txlist_fetcher/blob.go b/driver/txlist_fetcher/blob.go index 902e7fe0d..f054e944d 100644 --- a/driver/txlist_fetcher/blob.go +++ b/driver/txlist_fetcher/blob.go @@ -49,7 +49,7 @@ func (d *BlobFetcher) Fetch( "blobHash", common.Bytes2Hex(meta.BlobHash[:]), ) - if kZGToVersionedHash( + if KZGToVersionedHash( kzg4844.Commitment(common.FromHex(sidecar.KzgCommitment)), ) == common.BytesToHash(meta.BlobHash[:]) { return common.Hex2Bytes(sidecar.Blob), nil @@ -59,8 +59,8 @@ func (d *BlobFetcher) Fetch( return nil, errSidecarNotFound } -// kZGToVersionedHash implements kzg_to_versioned_hash from EIP-4844 -func kZGToVersionedHash(kzg kzg4844.Commitment) common.Hash { +// KZGToVersionedHash implements kzg_to_versioned_hash from EIP-4844 +func KZGToVersionedHash(kzg kzg4844.Commitment) common.Hash { h := sha256.Sum256(kzg[:]) h[0] = blobCommitmentVersionKZG