cya
cya copied to clipboard
[Cadence 0.x] Add `ProtocolStateVersionUpgrade` service event
This PR adds a minimal version of a service event to upgrade the protocol state version (see also https://github.com/onflow/flow-go/pull/5428).
There is an integration test validating the new service event is processed in https://github.com/onflow/flow-go/pull/5477.
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
- This, combined with the limitations of upgrading contracts, makes adding