Skip to content

Commit 4a8ccb2

Browse files
Apply review comments
1 parent e9e537f commit 4a8ccb2

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

bootstrap/bootstrap.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -360,30 +360,30 @@ func (fnb *EVMGatewayNodeBuilder) eventIngestionEngineComponent(cfg config.Confi
360360
l.Info().Msg("bootstrap starting event ingestion")
361361

362362
// get latest cadence block from the network and the database
363-
gatewayLatestBlock, err := fnb.Client.GetLatestBlock(context.Background(), true)
363+
chainLatestBlock, err := fnb.Client.GetLatestBlock(context.Background(), true)
364364
if err != nil {
365365
return nil, fmt.Errorf("failed to get latest cadence block: %w", err)
366366
}
367367

368-
chainLatestHeight, err := fnb.Storages.Blocks.LatestCadenceHeight()
368+
gatewayLatestHeight, err := fnb.Storages.Blocks.LatestCadenceHeight()
369369
if err != nil {
370370
return nil, err
371371
}
372372

373373
// make sure the provided block to start the indexing can be loaded
374-
_, err = fnb.Client.GetBlockHeaderByHeight(context.Background(), chainLatestHeight)
374+
_, err = fnb.Client.GetBlockHeaderByHeight(context.Background(), chainLatestBlock.Height)
375375
if err != nil {
376376
return nil, fmt.Errorf(
377377
"failed to get provided cadence height %d: %w",
378-
chainLatestHeight,
378+
chainLatestBlock.Height,
379379
err,
380380
)
381381
}
382382

383383
l.Info().
384-
Uint64("chain-cadence-height", chainLatestHeight).
385-
Uint64("gateway-cadence-height", gatewayLatestBlock.Height).
386-
Uint64("missed-heights", gatewayLatestBlock.Height-chainLatestHeight).
384+
Uint64("chain-cadence-height", chainLatestBlock.Height).
385+
Uint64("gateway-cadence-height", gatewayLatestHeight).
386+
Uint64("missed-heights", chainLatestBlock.Height-gatewayLatestHeight).
387387
Msg("indexing cadence height information")
388388

389389
chainID := cfg.FlowNetworkID
@@ -394,7 +394,7 @@ func (fnb *EVMGatewayNodeBuilder) eventIngestionEngineComponent(cfg config.Confi
394394
fnb.Client,
395395
chainID,
396396
fnb.Keystore,
397-
chainLatestHeight,
397+
chainLatestBlock.Height,
398398
)
399399

400400
callTracerCollector, err := replayer.NewCallTracerCollector(fnb.Logger)

services/requester/key_store_component.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ func (k *KeyStoreComponent) Start(ctx irrecoverable.SignalerContext) {
5858
return
5959
}
6060
for _, key := range account.Keys {
61+
// Skip account keys that do not use the same Public Key as the
62+
// configured crypto.Signer object.
63+
if !key.PublicKey.Equals(signer.PublicKey()) {
64+
continue
65+
}
66+
6167
accountKeys = append(accountKeys, &AccountKey{
6268
AccountKey: *key,
6369
Address: k.config.COAAddress,

0 commit comments

Comments
 (0)