mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-06 19:06:42 +01:00
Bound the filter of init SC events by blocks
When querying the init event for each smart contract, bound the search from block genesis-24h to block genesis. Otherwise, this query in geth synced to mainnet takes too long.
This commit is contained in:
@@ -704,15 +704,15 @@ func (s *Synchronizer) reorg(uncleBlock *common.Block) (int64, error) {
|
||||
|
||||
func getInitialVariables(ethClient eth.ClientInterface,
|
||||
consts *common.SCConsts) (*common.SCVariables, *StartBlockNums, error) {
|
||||
rollupInit, rollupInitBlock, err := ethClient.RollupEventInit()
|
||||
rollupInit, rollupInitBlock, err := ethClient.RollupEventInit(consts.Auction.GenesisBlockNum)
|
||||
if err != nil {
|
||||
return nil, nil, tracerr.Wrap(fmt.Errorf("RollupEventInit: %w", err))
|
||||
}
|
||||
auctionInit, auctionInitBlock, err := ethClient.AuctionEventInit()
|
||||
auctionInit, auctionInitBlock, err := ethClient.AuctionEventInit(consts.Auction.GenesisBlockNum)
|
||||
if err != nil {
|
||||
return nil, nil, tracerr.Wrap(fmt.Errorf("AuctionEventInit: %w", err))
|
||||
}
|
||||
wDelayerInit, wDelayerInitBlock, err := ethClient.WDelayerEventInit()
|
||||
wDelayerInit, wDelayerInitBlock, err := ethClient.WDelayerEventInit(consts.Auction.GenesisBlockNum)
|
||||
if err != nil {
|
||||
return nil, nil, tracerr.Wrap(fmt.Errorf("WDelayerEventInit: %w", err))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user