Skip to content

Conversation

@roman-khimov
Copy link
Member

Not tested yet.

d5a9af5 is incompatible with the NeoFS
mainnet sidechain, so we add the old logic to the pre-Aspidochelone
behaviour. Changing flags at newMethodAndPrice() is a bit less convenient
unfortunately because this will affect interop validity checks, so let's have
this kludge here.
@roman-khimov roman-khimov added this to the v0.100.1 milestone Dec 16, 2022
@codecov
Copy link

codecov bot commented Dec 16, 2022

Codecov Report

Merging #2848 (3339824) into master (3e714a3) will decrease coverage by 0.07%.
The diff coverage is 93.75%.

@@            Coverage Diff             @@
##           master    #2848      +/-   ##
==========================================
- Coverage   85.06%   84.98%   -0.08%     
==========================================
  Files         329      329              
  Lines       42210    42216       +6     
==========================================
- Hits        35906    35878      -28     
- Misses       4843     4878      +35     
+ Partials     1461     1460       -1     
Impacted Files Coverage Δ
pkg/core/native/interop.go 72.72% <93.75%> (+2.30%) ⬆️
pkg/services/oracle/oracle.go 72.99% <0.00%> (-14.60%) ⬇️
pkg/services/oracle/request.go 58.18% <0.00%> (-5.00%) ⬇️
pkg/core/transaction/transaction.go 85.18% <0.00%> (-1.49%) ⬇️
pkg/core/blockchain.go 78.62% <0.00%> (+0.04%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@roman-khimov
Copy link
Member Author

Works like charm, mainnet/testnet compatibility is still there, neofs mainnet sidechain can be processed too.

@AnnaShaleva
Copy link
Member

Otherwise LGTM.

@roman-khimov roman-khimov merged commit 5fb9e13 into master Dec 19, 2022
@roman-khimov roman-khimov deleted the tune-management-callflags-for-aspidochelone branch December 19, 2022 06:41
AnnaShaleva added a commit to neo-project/neo 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 <[email protected]>
NGDAdmin pushed a commit to neo-project/neo 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 <[email protected]>

* 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 <[email protected]>

---------

Signed-off-by: Anna Shaleva <[email protected]>
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 <[email protected]>

* 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 <[email protected]>

---------

Signed-off-by: Anna Shaleva <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants