Skip to content

Commit

Permalink
chore: add some logs around protocol upgrade migration
Browse files Browse the repository at this point in the history
  • Loading branch information
wwestgarth committed Jul 2, 2024
1 parent a4ac5fb commit c3d0700
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/banking/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,12 +433,19 @@ func (e *Engine) restoreSeen(ctx context.Context, seen *types.BankingSeen, p *ty
}

if vgcontext.InProgressUpgradeFrom(ctx, "v0.76.8") {
e.log.Info("migration code updating primary bridge last seen",
logging.String("address", e.primaryBridgeView.CollateralBridgeAddress()),
logging.Uint64("last-seen", seen.LastSeenPrimaryEthBlock),
)
e.ethEventSource.UpdateContractBlock(
e.primaryBridgeView.CollateralBridgeAddress(),
e.primaryEthChainID,
seen.LastSeenPrimaryEthBlock,
)

e.log.Info("migration code updating primary bridge last seen",
logging.String("address", e.secondaryBridgeView.CollateralBridgeAddress()),
logging.Uint64("last-seen", seen.LastSeenSecondaryEthBlock),
)
e.ethEventSource.UpdateContractBlock(
e.secondaryBridgeView.CollateralBridgeAddress(),
e.secondaryEthChainID,
Expand Down
4 changes: 4 additions & 0 deletions core/evtforward/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,10 @@ func (t *Tracker) LoadState(ctx context.Context, payload *types.Payload) ([]type
func (t *Tracker) OnStateLoaded(_ context.Context) error {
for _, bridge := range t.bridges {
for address, lastSeen := range bridge.contractAddresses {
t.log.Info("updating starting block after restore",
logging.String("address", address),
logging.Uint64("last-seen", lastSeen),
)
bridge.engine.UpdateStartingBlock(address, lastSeen)
}
}
Expand Down
5 changes: 5 additions & 0 deletions core/staking/accounting_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ func (a *Accounting) restoreStakingAccounts(ctx context.Context, accounts *types
if vgcontext.InProgressUpgradeFrom(ctx, "v0.76.8") {
lastSeen := a.getLastBlockSeen()
for _, addr := range a.stakingBridgeAddresses {
a.log.Info("migration code updating multisig last seen",
logging.String("address", addr.Hex()),
logging.Uint64("last-seen", lastSeen),
logging.String("chain-id", a.chainID),
)
a.ethSource.UpdateContractBlock(addr.Hex(), a.chainID, lastSeen)
}
}
Expand Down
6 changes: 6 additions & 0 deletions core/validators/erc20multisig/topology_snapshot_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ func (t *Topology) restoreVerifiedState(

if vgcontext.InProgressUpgradeFrom(ctx, "v0.76.8") {
lastSeen := t.getLastBlockSeen()

t.log.Info("migration code updating multisig last seen",
logging.String("address", t.ocv.GetMultiSigAddress()),
logging.Uint64("last-seen", lastSeen),
logging.String("chain-id", t.chainID),
)
t.ethEventSource.UpdateContractBlock(t.ocv.GetMultiSigAddress(), t.chainID, lastSeen)
}

Expand Down

0 comments on commit c3d0700

Please sign in to comment.