Skip to content

Conversation

@avalonche
Copy link

No description provided.

@avalonche avalonche force-pushed the add-flashtestations-monitoring branch 4 times, most recently from 1c8755a to 4208907 Compare November 5, 2025 19:50
@avalonche avalonche force-pushed the add-flashtestations-monitoring branch from 4208907 to 7e169ef Compare November 5, 2025 19:58
@avalonche avalonche force-pushed the add-flashtestations-monitoring branch from f221a9c to 00061b9 Compare November 7, 2025 06:57
zap.Error(err),
zap.String("tx", txHash.Hex()),
)
l2.registrationsError++
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue:

handleRegistrationTx is ran in its own goroutine, potentially multiple at the same time (e.g. if chain-monitor is catching up after being down for a few seconds). meaning that if it changes state, then it must be protected somehow (e.g. behind a mutex).

the processBlock that calls handleRegistrationTx doesn't need mutexes b/c it's guaranteed to always have only 1 instance of it running (it's being triggered by the timer, which doesn't fire the next tick if the previous didn't finish).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it fine to have handleRegistrationTx blocking then? I don't think chain-monitor is latency sensitive as long as it can alert us within 5 - 10 minutes. Its also not expected to be called often

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean with "blocking"?

it's good that it's branched-off into its own gorouting b/c that makes main timer-loop small and tidy. otherwise, if it gets bloated with many RPC calls, and error handling of these calls, then it can happen that it will begin to fall back on tracking the latest block just because of that (already did happen).

so, ideally there should be something that would guard against concurrent access to the state (mutes, atomic) + retry logic (truncated exponential backoff)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants