Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cadence 1.0] Add ProtocolStateVersionUpgrade service event #419

Conversation

jordanschalm
Copy link
Member

@jordanschalm jordanschalm commented Apr 8, 2024

This PR adds a minimal version of a service event to upgrade the protocol state version (see also onflow/flow-go#5428). This is a Cadence 1.0 compatible port of #411.

There is an integration test validating the new service event is processed in onflow/flow-go#5477.

Context

The plan is to deploy this changes alongside EFM Recovery (see branch

Outstanding TODOs


For now, I have added this service event to the NodeVersionBeacon contract, which has some benefits and drawbacks:

  • Conceptually ProtocolStateVersionUpgrade does something similar to the existing Version Beacon, so it makes sense for their logic to be together
  • The Version Beacon contract already has a Heartbeat resource hooked up to the system chunk, which is necessary to emit service events
  • The existing version beacon code is written in a way that suggests the version it is operating on is global, rather than specifically scoped to the Execution State Machine
    • This, combined with the limitations of upgrading contracts, makes adding ProtocolStateVersionUpgrade cleanly difficult

contracts/NodeVersionBeacon.cdc Outdated Show resolved Hide resolved
contracts/NodeVersionBeacon.cdc Outdated Show resolved Hide resolved
Previously service events could only be emitted in the system chunk.
With onflow/flow-go#5828, we can directly emit
them in governance transactions.
jordanschalm added a commit to onflow/flow-go that referenced this pull request May 7, 2024
@jordanschalm jordanschalm changed the base branch from stable-cadence to feature/efm-recovery October 28, 2024 15:57
@jordanschalm jordanschalm changed the base branch from feature/efm-recovery to stable-cadence October 28, 2024 15:57
@jordanschalm
Copy link
Member Author

Closing in favour of #464

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.

2 participants