Skip to content

Conversation

@joshuahannan
Copy link
Member

@joshuahannan joshuahannan commented Nov 3, 2025

Closes #527

Since epoch transitions already take a lot of computation, we shouldn't process scheduled transactions in the same block that epoch transitions are occurring.

Processing always happens before the epoch heartbeat, so we can make all the same checks that the epoch contract makes.

Adds a utility function to FlowEpoch to indicate if a phase transition is occurring so other system contracts can potentially use it in the future.

  • Adds tests in the Epoch Go tests to validate the phase transition function

// or expensive operations
// We don't skip if it is running in a test environment,
// so we check automaticRewardsEnabled() because it is only true on testnet and mainnet.
if FlowEpoch.isPhaseTransition() && FlowEpoch.automaticRewardsEnabled() {
Copy link
Member Author

Choose a reason for hiding this comment

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

I want to skip this check if it is on the emulator because epochs don't run on the emulator. Is checking automatic rewards enabled an okay way to do that? I assume that it is only enabled on testnet and mainnet

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.

Scheduled Txs: Do not process callbacks during epoch transactions

3 participants