Skip to content

Commit

Permalink
Apply review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
janezpodhostnik committed Jan 8, 2025
1 parent e9e537f commit 3e04bc3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
16 changes: 8 additions & 8 deletions bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -394,7 +394,7 @@ func (fnb *EVMGatewayNodeBuilder) eventIngestionEngineComponent(cfg config.Confi
fnb.Client,
chainID,
fnb.Keystore,
chainLatestHeight,
gatewayLatestHeight,
)

callTracerCollector, err := replayer.NewCallTracerCollector(fnb.Logger)
Expand Down
6 changes: 6 additions & 0 deletions services/requester/key_store_component.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3e04bc3

Please sign in to comment.