From 4a8ccb2c9fc399ccb07917321b96740db36d58e3 Mon Sep 17 00:00:00 2001 From: Janez Podhostnik Date: Wed, 8 Jan 2025 16:27:11 +0100 Subject: [PATCH] Apply review comments --- bootstrap/bootstrap.go | 16 ++++++++-------- services/requester/key_store_component.go | 6 ++++++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/bootstrap/bootstrap.go b/bootstrap/bootstrap.go index 696a584e..06d71f91 100644 --- a/bootstrap/bootstrap.go +++ b/bootstrap/bootstrap.go @@ -360,30 +360,30 @@ func (fnb *EVMGatewayNodeBuilder) eventIngestionEngineComponent(cfg config.Confi l.Info().Msg("bootstrap starting event ingestion") // get latest cadence block from the network and the database - gatewayLatestBlock, err := fnb.Client.GetLatestBlock(context.Background(), true) + chainLatestBlock, err := fnb.Client.GetLatestBlock(context.Background(), true) if err != nil { return nil, fmt.Errorf("failed to get latest cadence block: %w", err) } - chainLatestHeight, err := fnb.Storages.Blocks.LatestCadenceHeight() + gatewayLatestHeight, err := fnb.Storages.Blocks.LatestCadenceHeight() if err != nil { return nil, err } // make sure the provided block to start the indexing can be loaded - _, err = fnb.Client.GetBlockHeaderByHeight(context.Background(), chainLatestHeight) + _, err = fnb.Client.GetBlockHeaderByHeight(context.Background(), chainLatestBlock.Height) if err != nil { return nil, fmt.Errorf( "failed to get provided cadence height %d: %w", - chainLatestHeight, + chainLatestBlock.Height, err, ) } l.Info(). - Uint64("chain-cadence-height", chainLatestHeight). - Uint64("gateway-cadence-height", gatewayLatestBlock.Height). - Uint64("missed-heights", gatewayLatestBlock.Height-chainLatestHeight). + Uint64("chain-cadence-height", chainLatestBlock.Height). + Uint64("gateway-cadence-height", gatewayLatestHeight). + Uint64("missed-heights", chainLatestBlock.Height-gatewayLatestHeight). Msg("indexing cadence height information") chainID := cfg.FlowNetworkID @@ -394,7 +394,7 @@ func (fnb *EVMGatewayNodeBuilder) eventIngestionEngineComponent(cfg config.Confi fnb.Client, chainID, fnb.Keystore, - chainLatestHeight, + chainLatestBlock.Height, ) callTracerCollector, err := replayer.NewCallTracerCollector(fnb.Logger) diff --git a/services/requester/key_store_component.go b/services/requester/key_store_component.go index 8324c827..9cab8aff 100644 --- a/services/requester/key_store_component.go +++ b/services/requester/key_store_component.go @@ -58,6 +58,12 @@ func (k *KeyStoreComponent) Start(ctx irrecoverable.SignalerContext) { return } for _, key := range account.Keys { + // Skip account keys that do not use the same Public Key as the + // configured crypto.Signer object. + if !key.PublicKey.Equals(signer.PublicKey()) { + continue + } + accountKeys = append(accountKeys, &AccountKey{ AccountKey: *key, Address: k.config.COAAddress,