mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-06 19:06:42 +01:00
Fix synchronizer, add verifier index config param
- eth
- In EventsByBlock calls ignore blockNum if blockHash != nil. This fixes
the issue where a blockNumber and blockHash was being passed, which the
eth events query function doesn't allow, causing the synchronizer to fail
at every iteration.
- Node/Config
- Add Coordinator.Debug.RollupVerifierIndex to force choosing a particular
verifier by index in the Rollup smart contract.
This commit is contained in:
@@ -799,14 +799,14 @@ func (c *AuctionClient) AuctionEventInit() (*AuctionEventInitialize, int64, erro
|
||||
// AuctionEventsByBlock returns the events in a block that happened in the
|
||||
// Auction Smart Contract.
|
||||
// To query by blockNum, set blockNum >= 0 and blockHash == nil.
|
||||
// To query by blockHash, set blockNum == -1 and blockHash != nil.
|
||||
// To query by blockHash set blockHash != nil, and blockNum will be ignored.
|
||||
// If there are no events in that block the result is nil.
|
||||
func (c *AuctionClient) AuctionEventsByBlock(blockNum int64,
|
||||
blockHash *ethCommon.Hash) (*AuctionEvents, error) {
|
||||
var auctionEvents AuctionEvents
|
||||
|
||||
var blockNumBigInt *big.Int
|
||||
if blockNum >= 0 {
|
||||
if blockHash == nil {
|
||||
blockNumBigInt = big.NewInt(blockNum)
|
||||
}
|
||||
query := ethereum.FilterQuery{
|
||||
|
||||
@@ -738,14 +738,14 @@ func (c *RollupClient) RollupEventInit() (*RollupEventInitialize, int64, error)
|
||||
// RollupEventsByBlock returns the events in a block that happened in the
|
||||
// Rollup Smart Contract.
|
||||
// To query by blockNum, set blockNum >= 0 and blockHash == nil.
|
||||
// To query by blockHash, set blockNum == -1 and blockHash != nil.
|
||||
// To query by blockHash set blockHash != nil, and blockNum will be ignored.
|
||||
// If there are no events in that block the result is nil.
|
||||
func (c *RollupClient) RollupEventsByBlock(blockNum int64,
|
||||
blockHash *ethCommon.Hash) (*RollupEvents, error) {
|
||||
var rollupEvents RollupEvents
|
||||
|
||||
var blockNumBigInt *big.Int
|
||||
if blockNum >= 0 {
|
||||
if blockHash == nil {
|
||||
blockNumBigInt = big.NewInt(blockNum)
|
||||
}
|
||||
query := ethereum.FilterQuery{
|
||||
|
||||
@@ -426,14 +426,14 @@ func (c *WDelayerClient) WDelayerEventInit() (*WDelayerEventInitialize, int64, e
|
||||
// WDelayerEventsByBlock returns the events in a block that happened in the
|
||||
// WDelayer Smart Contract.
|
||||
// To query by blockNum, set blockNum >= 0 and blockHash == nil.
|
||||
// To query by blockHash, set blockNum == -1 and blockHash != nil.
|
||||
// To query by blockHash set blockHash != nil, and blockNum will be ignored.
|
||||
// If there are no events in that block the result is nil.
|
||||
func (c *WDelayerClient) WDelayerEventsByBlock(blockNum int64,
|
||||
blockHash *ethCommon.Hash) (*WDelayerEvents, error) {
|
||||
var wdelayerEvents WDelayerEvents
|
||||
|
||||
var blockNumBigInt *big.Int
|
||||
if blockNum >= 0 {
|
||||
if blockHash == nil {
|
||||
blockNumBigInt = big.NewInt(blockNum)
|
||||
}
|
||||
query := ethereum.FilterQuery{
|
||||
|
||||
Reference in New Issue
Block a user