diff --git a/docs/node-configuration.md b/docs/node-configuration.md index c37fefd43..3897dda6e 100644 --- a/docs/node-configuration.md +++ b/docs/node-configuration.md @@ -470,7 +470,7 @@ in development and can change in an incompatible way. | `Basilisk` | Enables strict smart contract script check against a set of JMP instructions and against method boundaries enabled on contract deploy or update. Increases `stackitem.Integer` JSON parsing precision up to the maximum value supported by the NeoVM. Enables strict check for notifications emitted by a contract to precisely match the events specified in the contract manifest. | https://github.com/nspcc-dev/neo-go/pull/3056
https://github.com/neo-project/neo/pull/2881
https://github.com/nspcc-dev/neo-go/pull/3080
https://github.com/neo-project/neo/pull/2883
https://github.com/nspcc-dev/neo-go/pull/3085
https://github.com/neo-project/neo/pull/2810 | | `Cockatrice` | Introduces the ability to update native contracts. Includes a couple of new native smart contract APIs: `keccak256` of native CryptoLib contract and `getCommitteeAddress` of native NeoToken contract. | https://github.com/nspcc-dev/neo-go/pull/3402
https://github.com/neo-project/neo/pull/2942
https://github.com/nspcc-dev/neo-go/pull/3301
https://github.com/neo-project/neo/pull/2925
https://github.com/nspcc-dev/neo-go/pull/3362
https://github.com/neo-project/neo/pull/3154 | | `Domovoi` | Makes node use executing contract state for the contract call permissions check instead of the state stored in the native Management contract. In C# also makes System.Runtime.GetNotifications interop properly count stack references of notification parameters which prevents users from creating objects that exceed MaxStackSize constraint, but NeoGo has never had this bug, thus proper behaviour is preserved even before HFDomovoi. It results in the fact that some T5 testnet transactions have different ApplicationLogs compared to the C# node, but the node states match. | https://github.com/nspcc-dev/neo-go/pull/3476
https://github.com/neo-project/neo/pull/3290
https://github.com/nspcc-dev/neo-go/pull/3473
https://github.com/neo-project/neo/pull/3290
https://github.com/neo-project/neo/pull/3301
https://github.com/nspcc-dev/neo-go/pull/3485 | -| `Echidna` | Introduces `Designation` event extension with `Old` and `New` roles data to native RoleManagement contract. Adds support for `base64UrlEncode` and `base64UrlDecode` methods to native StdLib contract. | https://github.com/nspcc-dev/neo-go/pull/3554
https://github.com/nspcc-dev/neo-go/pull/3761 | +| `Echidna` | Introduces `Designation` event extension with `Old` and `New` roles data to native RoleManagement contract. Adds support for `base64UrlEncode` and `base64UrlDecode` methods to native StdLib contract. Extends the list of required call flags for `registerCandidate`, `unregisterCandidate`and `vote` methods of native NeoToken contract with AllowNotify flag. | https://github.com/nspcc-dev/neo-go/pull/3554
https://github.com/nspcc-dev/neo-go/pull/3761 | ## DB compatibility diff --git a/pkg/core/native/native_neo.go b/pkg/core/native/native_neo.go index 9978e0b97..d4e507826 100644 --- a/pkg/core/native/native_neo.go +++ b/pkg/core/native/native_neo.go @@ -192,18 +192,27 @@ func newNEO(cfg config.ProtocolConfiguration) *NEO { desc = newDescriptor("registerCandidate", smartcontract.BoolType, manifest.NewParameter("pubkey", smartcontract.PublicKeyType)) - md = newMethodAndPrice(n.registerCandidate, 0, callflag.States) + md = newMethodAndPrice(n.registerCandidate, 0, callflag.States, config.HFDefault, config.HFEchidna) + n.AddMethod(md, desc) + + md = newMethodAndPrice(n.registerCandidate, 0, callflag.States|callflag.AllowNotify, config.HFEchidna) n.AddMethod(md, desc) desc = newDescriptor("unregisterCandidate", smartcontract.BoolType, manifest.NewParameter("pubkey", smartcontract.PublicKeyType)) - md = newMethodAndPrice(n.unregisterCandidate, 1<<16, callflag.States) + md = newMethodAndPrice(n.unregisterCandidate, 1<<16, callflag.States, config.HFDefault, config.HFEchidna) + n.AddMethod(md, desc) + + md = newMethodAndPrice(n.unregisterCandidate, 1<<16, callflag.States|callflag.AllowNotify, config.HFEchidna) n.AddMethod(md, desc) desc = newDescriptor("vote", smartcontract.BoolType, manifest.NewParameter("account", smartcontract.Hash160Type), manifest.NewParameter("voteTo", smartcontract.PublicKeyType)) - md = newMethodAndPrice(n.vote, 1<<16, callflag.States) + md = newMethodAndPrice(n.vote, 1<<16, callflag.States, config.HFDefault, config.HFEchidna) + n.AddMethod(md, desc) + + md = newMethodAndPrice(n.vote, 1<<16, callflag.States|callflag.AllowNotify, config.HFEchidna) n.AddMethod(md, desc) desc = newDescriptor("getCandidates", smartcontract.ArrayType) diff --git a/pkg/interop/native/neo/neo.go b/pkg/interop/native/neo/neo.go index d536edd74..239ad266a 100644 --- a/pkg/interop/native/neo/neo.go +++ b/pkg/interop/native/neo/neo.go @@ -104,17 +104,17 @@ func SetRegisterPrice(amount int) { // RegisterCandidate represents `registerCandidate` method of NEO native contract. func RegisterCandidate(pub interop.PublicKey) bool { - return neogointernal.CallWithToken(Hash, "registerCandidate", int(contract.States), pub).(bool) + return neogointernal.CallWithToken(Hash, "registerCandidate", int(contract.States|contract.AllowNotify), pub).(bool) } // UnregisterCandidate represents `unregisterCandidate` method of NEO native contract. func UnregisterCandidate(pub interop.PublicKey) bool { - return neogointernal.CallWithToken(Hash, "unregisterCandidate", int(contract.States), pub).(bool) + return neogointernal.CallWithToken(Hash, "unregisterCandidate", int(contract.States|contract.AllowNotify), pub).(bool) } // Vote represents `vote` method of NEO native contract. func Vote(addr interop.Hash160, pub interop.PublicKey) bool { - return neogointernal.CallWithToken(Hash, "vote", int(contract.States), addr, pub).(bool) + return neogointernal.CallWithToken(Hash, "vote", int(contract.States|contract.AllowNotify), addr, pub).(bool) } // UnclaimedGAS represents `unclaimedGas` method of NEO native contract.