-
Notifications
You must be signed in to change notification settings - Fork 156
Open
Labels
Description
Changing names or types of events changes their signatures, which will break consensus because older versions of the rust code may use outdated event signatures to filter events. We need to add snapshot tests that show when a breaking change is made to the stake table contract.
These are the signatures
espresso-network/types/src/v0/impls/stake_table.rs
Lines 1047 to 1058 in 1c5e304
| .events([ | |
| ValidatorRegistered::SIGNATURE, | |
| ValidatorRegisteredV2::SIGNATURE, | |
| ValidatorExit::SIGNATURE, | |
| ValidatorExitV2::SIGNATURE, | |
| Delegated::SIGNATURE, | |
| Undelegated::SIGNATURE, | |
| UndelegatedV2::SIGNATURE, | |
| ConsensusKeysUpdated::SIGNATURE, | |
| ConsensusKeysUpdatedV2::SIGNATURE, | |
| CommissionUpdated::SIGNATURE, | |
| ]) |
We should also capture the fact that these are consensus events more clearly in the code, like we do for the events themselves
espresso-network/types/src/v0/v0_3/stake_table.rs
Lines 137 to 149 in 1c5e304
| #[derive(Clone, derive_more::From, PartialEq, serde::Serialize, serde::Deserialize)] | |
| pub enum StakeTableEvent { | |
| Register(ValidatorRegistered), | |
| RegisterV2(ValidatorRegisteredV2), | |
| Deregister(ValidatorExit), | |
| DeregisterV2(ValidatorExitV2), | |
| Delegate(Delegated), | |
| Undelegate(Undelegated), | |
| UndelegateV2(UndelegatedV2), | |
| KeyUpdate(ConsensusKeysUpdated), | |
| KeyUpdateV2(ConsensusKeysUpdatedV2), | |
| CommissionUpdate(CommissionUpdated), | |
| } |