Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
zkokelj committed Jan 17, 2025
1 parent 162b363 commit e598494
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions go/enclave/nodetype/sequencer.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,33 +478,3 @@ func (s *sequencer) OnL1Block(ctx context.Context, block *types.Header, result *
func (s *sequencer) Close() error {
return s.mempool.Close()
}

func createRollupSignatureHash(header *common.RollupHeader, blobHash gethcommon.Hash) gethcommon.Hash {
return gethcrypto.Keccak256Hash(
blobHash.Bytes(), // Hash from blob
gethcommon.Hash{}.Bytes(), // MessageRoot (zero for now)
header.CompressionL1Head.Bytes(), // Block binding
big.NewInt(int64(header.LastBatchSeqNo)).Bytes(), // Last sequence number
)
}

func (s *sequencer) signRollup(rollup *common.ExtRollup) error {
// Get the blob hash from first blob
var blobHash gethcommon.Hash
if len(rollup.BlobData) > 0 {
commitment, err := kzg4844.BlobToCommitment(rollup.BlobData[0])
if err != nil {
return fmt.Errorf("cannot compute KZG commitment: %w", err)
}
blobHash = ethadapter.KZGToVersionedHash(commitment)
}

// Create and sign the composite hash
signatureHash := createRollupSignatureHash(rollup.Header, blobHash)
var err error
rollup.Header.Signature, err = s.enclaveKeyService.Sign(signatureHash)
if err != nil {
return fmt.Errorf("could not sign rollup: %w", err)
}
return nil
}

0 comments on commit e598494

Please sign in to comment.