Change Deploy and Update CallFlags#2653
Merged
shargon merged 1 commit intoneo-project:masterfrom Jan 25, 2022
Merged
Conversation
erikzhang
approved these changes
Jan 25, 2022
roman-khimov
added a commit
to nspcc-dev/neo-go
that referenced
this pull request
Jan 31, 2022
roman-khimov
added a commit
to nspcc-dev/neo-go
that referenced
this pull request
Feb 1, 2022
AnnaShaleva
pushed a commit
to nspcc-dev/neo-go
that referenced
this pull request
Feb 17, 2022
ixje
added a commit
to CityOfZion/neo-mamba
that referenced
this pull request
Apr 4, 2022
ixje
added a commit
to CityOfZion/neo-mamba
that referenced
this pull request
Apr 4, 2022
AnnaShaleva
added a commit
that referenced
this pull request
Apr 22, 2025
#2653 changed required callflags of native ContractManagement's Update and Deploy methods from States|AllowNotify to All. This change didn't affect N3 mainnet/T5 (ref. #2673), but the problem is that this change affected NeoFS mainnet network (see nspcc-dev/neo-go#2848 and commits description). This commit fixes state difference between Go and C# nodes at height 451626 of NeoFS mainnet. Note that this commit does not affect existing N3 mainnet/testnet states, so no resynchronisation is required on update. The difference itself: ``` go run scripts/compare-dumps/compare-dumps.go ./godump-echidna-neofs-mainnet/ ../../neo-project/neo/neo-cli-notary-mainnet/Storage_0572dfa5/ Processing directory BlockStorage_0 Processing directory BlockStorage_100000 Processing directory BlockStorage_200000 Processing directory BlockStorage_300000 Processing directory BlockStorage_400000 Processing directory BlockStorage_500000 file BlockStorage_500000/dump-block-452000.json: block 451626, changes length mismatch: 25 vs 11 compare-dumps dumpDirA dumpDirB exit status 1 ``` Go node application log for the problem transaction: ``` anna@kiwi:~/Documents/GitProjects/nspcc-dev/neo-go$ curl -d '{ "jsonrpc": "2.0", "id": 1, "method": "getapplicationlog", "params": ["0x5028585a5c27b7f357771fa8b512c2d1b0ba40dcb3ea30e67d3db2d75d2da60d"] }' localhost:40332 | json_pp % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 592 100 450 100 142 461k 145k --:--:-- --:--:-- --:--:-- 578k { "id" : 1, "jsonrpc" : "2.0", "result" : { "executions" : [ { "exception" : null, "gasconsumed" : "900316660", "invocations" : null, "notifications" : [ { "contract" : "0xfffdc93764dbaddd97c48f252a53ea4643faa3fd", "eventname" : "Update", "state" : { "type" : "Array", "value" : [ { "type" : "ByteString", "value" : "r6jbcP2s5N7DIvRYS2ZiFdP7YXA=" } ] } } ], "stack" : [ { "type" : "Any" } ], "trigger" : "Application", "vmstate" : "HALT" } ], "txid" : "0x5028585a5c27b7f357771fa8b512c2d1b0ba40dcb3ea30e67d3db2d75d2da60d" } } ``` C# application log for the same transaction: ``` anna@kiwi:~/Documents/GitProjects/nspcc-dev/neo-go$ curl -d '{ "jsonrpc": "2.0", "id": 1, "method": "getapplicationlog", "params": ["0x5028585a5c27b7f357771fa8b512c2d1b0ba40dcb3ea30e67d3db2d75d2da60d"] }' localhost:50332 | json_pp % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 439 0 297 100 142 3502 1674 --:--:-- --:--:-- --:--:-- 5226 { "id" : 1, "jsonrpc" : "2.0", "result" : { "executions" : [ { "exception" : "Cannot call this method with the flag States, AllowNotify.", "gasconsumed" : "5684010", "notifications" : [], "stack" : [], "trigger" : "Application", "vmstate" : "FAULT" } ], "txid" : "0x5028585a5c27b7f357771fa8b512c2d1b0ba40dcb3ea30e67d3db2d75d2da60d" } } ``` Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
11 tasks
NGDAdmin
pushed a commit
that referenced
this pull request
Apr 24, 2025
…3909) * Native: revert Update/Deploy callflag change for pre-Aspidochelone #2653 changed required callflags of native ContractManagement's Update and Deploy methods from States|AllowNotify to All. This change didn't affect N3 mainnet/T5 (ref. #2673), but the problem is that this change affected NeoFS mainnet network (see nspcc-dev/neo-go#2848 and commits description). This commit fixes state difference between Go and C# nodes at height 451626 of NeoFS mainnet. Note that this commit does not affect existing N3 mainnet/testnet states, so no resynchronisation is required on update. The difference itself: ``` go run scripts/compare-dumps/compare-dumps.go ./godump-echidna-neofs-mainnet/ ../../neo-project/neo/neo-cli-notary-mainnet/Storage_0572dfa5/ Processing directory BlockStorage_0 Processing directory BlockStorage_100000 Processing directory BlockStorage_200000 Processing directory BlockStorage_300000 Processing directory BlockStorage_400000 Processing directory BlockStorage_500000 file BlockStorage_500000/dump-block-452000.json: block 451626, changes length mismatch: 25 vs 11 compare-dumps dumpDirA dumpDirB exit status 1 ``` Go node application log for the problem transaction: ``` anna@kiwi:~/Documents/GitProjects/nspcc-dev/neo-go$ curl -d '{ "jsonrpc": "2.0", "id": 1, "method": "getapplicationlog", "params": ["0x5028585a5c27b7f357771fa8b512c2d1b0ba40dcb3ea30e67d3db2d75d2da60d"] }' localhost:40332 | json_pp % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 592 100 450 100 142 461k 145k --:--:-- --:--:-- --:--:-- 578k { "id" : 1, "jsonrpc" : "2.0", "result" : { "executions" : [ { "exception" : null, "gasconsumed" : "900316660", "invocations" : null, "notifications" : [ { "contract" : "0xfffdc93764dbaddd97c48f252a53ea4643faa3fd", "eventname" : "Update", "state" : { "type" : "Array", "value" : [ { "type" : "ByteString", "value" : "r6jbcP2s5N7DIvRYS2ZiFdP7YXA=" } ] } } ], "stack" : [ { "type" : "Any" } ], "trigger" : "Application", "vmstate" : "HALT" } ], "txid" : "0x5028585a5c27b7f357771fa8b512c2d1b0ba40dcb3ea30e67d3db2d75d2da60d" } } ``` C# application log for the same transaction: ``` anna@kiwi:~/Documents/GitProjects/nspcc-dev/neo-go$ curl -d '{ "jsonrpc": "2.0", "id": 1, "method": "getapplicationlog", "params": ["0x5028585a5c27b7f357771fa8b512c2d1b0ba40dcb3ea30e67d3db2d75d2da60d"] }' localhost:50332 | json_pp % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 439 0 297 100 142 3502 1674 --:--:-- --:--:-- --:--:-- 5226 { "id" : 1, "jsonrpc" : "2.0", "result" : { "executions" : [ { "exception" : "Cannot call this method with the flag States, AllowNotify.", "gasconsumed" : "5684010", "notifications" : [], "stack" : [], "trigger" : "Application", "vmstate" : "FAULT" } ], "txid" : "0x5028585a5c27b7f357771fa8b512c2d1b0ba40dcb3ea30e67d3db2d75d2da60d" } } ``` Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru> * Native: move Update/Deploy callflags check to Management implementation Make these checks implementation-specific in order not to affect the general native invocation code. Ref. #3909 (review). Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru> --------- Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
cschuchardt88
pushed a commit
to cschuchardt88/neo
that referenced
this pull request
Jun 8, 2025
…eo-project#3909) * Native: revert Update/Deploy callflag change for pre-Aspidochelone neo-project#2653 changed required callflags of native ContractManagement's Update and Deploy methods from States|AllowNotify to All. This change didn't affect N3 mainnet/T5 (ref. neo-project#2673), but the problem is that this change affected NeoFS mainnet network (see nspcc-dev/neo-go#2848 and commits description). This commit fixes state difference between Go and C# nodes at height 451626 of NeoFS mainnet. Note that this commit does not affect existing N3 mainnet/testnet states, so no resynchronisation is required on update. The difference itself: ``` go run scripts/compare-dumps/compare-dumps.go ./godump-echidna-neofs-mainnet/ ../../neo-project/neo/neo-cli-notary-mainnet/Storage_0572dfa5/ Processing directory BlockStorage_0 Processing directory BlockStorage_100000 Processing directory BlockStorage_200000 Processing directory BlockStorage_300000 Processing directory BlockStorage_400000 Processing directory BlockStorage_500000 file BlockStorage_500000/dump-block-452000.json: block 451626, changes length mismatch: 25 vs 11 compare-dumps dumpDirA dumpDirB exit status 1 ``` Go node application log for the problem transaction: ``` anna@kiwi:~/Documents/GitProjects/nspcc-dev/neo-go$ curl -d '{ "jsonrpc": "2.0", "id": 1, "method": "getapplicationlog", "params": ["0x5028585a5c27b7f357771fa8b512c2d1b0ba40dcb3ea30e67d3db2d75d2da60d"] }' localhost:40332 | json_pp % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 592 100 450 100 142 461k 145k --:--:-- --:--:-- --:--:-- 578k { "id" : 1, "jsonrpc" : "2.0", "result" : { "executions" : [ { "exception" : null, "gasconsumed" : "900316660", "invocations" : null, "notifications" : [ { "contract" : "0xfffdc93764dbaddd97c48f252a53ea4643faa3fd", "eventname" : "Update", "state" : { "type" : "Array", "value" : [ { "type" : "ByteString", "value" : "r6jbcP2s5N7DIvRYS2ZiFdP7YXA=" } ] } } ], "stack" : [ { "type" : "Any" } ], "trigger" : "Application", "vmstate" : "HALT" } ], "txid" : "0x5028585a5c27b7f357771fa8b512c2d1b0ba40dcb3ea30e67d3db2d75d2da60d" } } ``` C# application log for the same transaction: ``` anna@kiwi:~/Documents/GitProjects/nspcc-dev/neo-go$ curl -d '{ "jsonrpc": "2.0", "id": 1, "method": "getapplicationlog", "params": ["0x5028585a5c27b7f357771fa8b512c2d1b0ba40dcb3ea30e67d3db2d75d2da60d"] }' localhost:50332 | json_pp % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 439 0 297 100 142 3502 1674 --:--:-- --:--:-- --:--:-- 5226 { "id" : 1, "jsonrpc" : "2.0", "result" : { "executions" : [ { "exception" : "Cannot call this method with the flag States, AllowNotify.", "gasconsumed" : "5684010", "notifications" : [], "stack" : [], "trigger" : "Application", "vmstate" : "FAULT" } ], "txid" : "0x5028585a5c27b7f357771fa8b512c2d1b0ba40dcb3ea30e67d3db2d75d2da60d" } } ``` Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru> * Native: move Update/Deploy callflags check to Management implementation Make these checks implementation-specific in order not to affect the general native invocation code. Ref. neo-project#3909 (review). Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru> --------- Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Close #2652