flow-core-contracts icon indicating copy to clipboard operation
flow-core-contracts copied to clipboard

[Cadence 0.x] Add `ProtocolStateVersionUpgrade` service event

Open jordanschalm opened this issue 2 years ago • 2 comments

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

jordanschalm avatar Feb 20 '24 17:02 jordanschalm

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

joshuahannan avatar Apr 01 '24 13:04 joshuahannan

Are you planning on doing this upgrade before or after the Cadence 1.0 upgrade?

After Cadence 1.0 -> 👍 I'll do that.

jordanschalm avatar Apr 01 '24 14:04 jordanschalm

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.)

jordanschalm avatar May 02 '24 15:05 jordanschalm