Improve native contract update mechanism #3210
Labels
Discussion
Initial issue state - proposed but not yet accepted
Enhancement
Type - Changes that may affect performance, usability or add new features to existing modules.
P1
High Priority: Targeting The Next Release
Milestone
Summary or problem description
Native contract update mechanism introduced in #2942 allows to enable new methods and events starting from some hardfork, and it's good. However, we're missing the following functionality:
Without this functionality implemented, changes like #3209 will inevitably require node resync, so we consider this functionality a useful one.
Do you have any solution you want to propose?
Almost all cases may be solved with
ActiveTill
field added to the native contract/method/event. The handler logic for this field should be similar to the logic of the following fields (with single adjustment:ActiveTill
prevents contract/method/event from being active):neo/src/Neo/SmartContract/Native/NativeContract.cs
Line 121 in 429a081
neo/src/Neo/SmartContract/Native/ContractMethodAttribute.cs
Line 25 in 429a081
neo/src/Neo/SmartContract/Native/ContractEventAttribute.cs
Line 24 in 429a081
Another option was suggested by @roman-khimov (correct me, if I'm wrong, please): we may have a set of separate classes for every version of native contract. Starting from every hardfork, a specific version of the contract should be used (if specified).
Where in the software does this update applies to?
The text was updated successfully, but these errors were encountered: