[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
ProtocolStateVersionUpgradedoes 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
ProtocolStateVersionUpgradecleanly difficult
- This, combined with the limitations of upgrading contracts, makes adding
Are you planning on doing this upgrade before or after the Cadence 1.0 upgrade? If the answer is after, we should make these changes based on the stable-cadence branch instead of master
Are you planning on doing this upgrade before or after the Cadence 1.0 upgrade?
After Cadence 1.0 -> 👍 I'll do that.
Closing in favour of https://github.com/onflow/flow-core-contracts/pull/419. (Keeping the branch open for now as it's pinned by a feature branch.)