|
@ -226,7 +226,7 @@ func NewSynchronizer(ethClient eth.ClientInterface, historyDB *historydb.History |
|
|
|
|
|
|
|
|
initVars, startBlockNums, err := getInitialVariables(ethClient, &consts) |
|
|
initVars, startBlockNums, err := getInitialVariables(ethClient, &consts) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return nil, err |
|
|
|
|
|
|
|
|
return nil, tracerr.Wrap(err) |
|
|
} |
|
|
} |
|
|
log.Infow("Synchronizer syncing from smart contract blocks", |
|
|
log.Infow("Synchronizer syncing from smart contract blocks", |
|
|
"rollup", startBlockNums.Rollup, |
|
|
"rollup", startBlockNums.Rollup, |
|
@ -587,15 +587,15 @@ func getInitialVariables(ethClient eth.ClientInterface, |
|
|
consts *SCConsts) (*SCVariables, *StartBlockNums, error) { |
|
|
consts *SCConsts) (*SCVariables, *StartBlockNums, error) { |
|
|
rollupInit, rollupInitBlock, err := ethClient.RollupEventInit() |
|
|
rollupInit, rollupInitBlock, err := ethClient.RollupEventInit() |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return nil, nil, err |
|
|
|
|
|
|
|
|
return nil, nil, tracerr.Wrap(err) |
|
|
} |
|
|
} |
|
|
auctionInit, auctionInitBlock, err := ethClient.AuctionEventInit() |
|
|
auctionInit, auctionInitBlock, err := ethClient.AuctionEventInit() |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return nil, nil, err |
|
|
|
|
|
|
|
|
return nil, nil, tracerr.Wrap(err) |
|
|
} |
|
|
} |
|
|
wDelayerInit, wDelayerInitBlock, err := ethClient.WDelayerEventInit() |
|
|
wDelayerInit, wDelayerInitBlock, err := ethClient.WDelayerEventInit() |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return nil, nil, err |
|
|
|
|
|
|
|
|
return nil, nil, tracerr.Wrap(err) |
|
|
} |
|
|
} |
|
|
rollupVars := rollupInit.RollupVariables() |
|
|
rollupVars := rollupInit.RollupVariables() |
|
|
auctionVars := auctionInit.AuctionVariables(consts.Auction.InitialMinimalBidding) |
|
|
auctionVars := auctionInit.AuctionVariables(consts.Auction.InitialMinimalBidding) |
|
@ -625,7 +625,7 @@ func (s *Synchronizer) resetState(block *common.Block) error { |
|
|
s.vars.Auction = *vars.Auction.Copy() |
|
|
s.vars.Auction = *vars.Auction.Copy() |
|
|
s.vars.WDelayer = *vars.WDelayer.Copy() |
|
|
s.vars.WDelayer = *vars.WDelayer.Copy() |
|
|
} else if err != nil { |
|
|
} else if err != nil { |
|
|
return err |
|
|
|
|
|
|
|
|
return tracerr.Wrap(err) |
|
|
} else { |
|
|
} else { |
|
|
s.vars.Rollup = *rollup |
|
|
s.vars.Rollup = *rollup |
|
|
s.vars.Auction = *auction |
|
|
s.vars.Auction = *auction |
|
@ -805,7 +805,7 @@ func (s *Synchronizer) rollupSync(ethBlock *common.Block) (*common.RollupData, e |
|
|
// Set TxID, BlockNum, BatchNum and Position to the forged L2Txs
|
|
|
// Set TxID, BlockNum, BatchNum and Position to the forged L2Txs
|
|
|
for i := range l2Txs { |
|
|
for i := range l2Txs { |
|
|
if err := l2Txs[i].SetID(); err != nil { |
|
|
if err := l2Txs[i].SetID(); err != nil { |
|
|
return nil, err |
|
|
|
|
|
|
|
|
return nil, tracerr.Wrap(err) |
|
|
} |
|
|
} |
|
|
l2Txs[i].EthBlockNum = blockNum |
|
|
l2Txs[i].EthBlockNum = blockNum |
|
|
l2Txs[i].BatchNum = batchNum |
|
|
l2Txs[i].BatchNum = batchNum |
|
|