From 4fc867154a781c22efb4f9f92958b69494d2e9ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20Ram=C3=ADrez?= <58293609+ToniRamirezM@users.noreply.github.com> Date: Fri, 2 Feb 2024 10:47:31 +0100 Subject: [PATCH] fix im state root in stream (#3192) --- sequencer/datastreamer.go | 1 + sequencer/sequencer.go | 9 --------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/sequencer/datastreamer.go b/sequencer/datastreamer.go index 9feac914e9..700b8b3e02 100644 --- a/sequencer/datastreamer.go +++ b/sequencer/datastreamer.go @@ -36,6 +36,7 @@ func (f *finalizer) DSSendL2Block(batchNumber uint64, blockResponse *state.Proce IsValid: 1, EncodedLength: uint32(len(binaryTxData)), Encoded: binaryTxData, + StateRoot: txResponse.StateRoot, } l2Transactions = append(l2Transactions, l2Transaction) diff --git a/sequencer/sequencer.go b/sequencer/sequencer.go index c43a1304e4..3bf4cf4fc1 100644 --- a/sequencer/sequencer.go +++ b/sequencer/sequencer.go @@ -3,7 +3,6 @@ package sequencer import ( "context" "fmt" - "math/big" "time" "github.com/0xPolygonHermez/zkevm-data-streamer/datastreamer" @@ -302,14 +301,6 @@ func (s *Sequencer) sendDataToStreamer(chainID uint64) { } for _, l2Transaction := range l2Block.Txs { - // Populate intermediate state root - position := state.GetSystemSCPosition(blockStart.L2BlockNumber) - imStateRoot, err := s.stateIntf.GetStorageAt(context.Background(), common.HexToAddress(state.SystemSC), big.NewInt(0).SetBytes(position), l2Block.StateRoot) - if err != nil { - log.Errorf("failed to get storage at for l2block %d, error: %v", l2Block.L2BlockNumber, err) - } - l2Transaction.StateRoot = common.BigToHash(imStateRoot) - _, err = s.streamServer.AddStreamEntry(state.EntryTypeL2Tx, l2Transaction.Encode()) if err != nil { log.Errorf("failed to add l2tx stream entry for l2block %d, error: %v", l2Block.L2BlockNumber, err)