• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

neo-project / neo / 13694720894

06 Mar 2025 08:49AM UTC coverage: 78.376% (+0.1%) from 78.259%
13694720894

push

github

web-flow
Transaction: ensure standard witness scripts are properly verified (#3805)

* Transaction: ensure standard witness scripts are properly verified

Problem:

Invocation scripts of standard witnesses considered to be invalid if not
following the `PUSHDATA1 signature` pattern. Consider the following
example of transaction witness:

Invocation script:
`CDkMQMPzMFVACq4PjnjbH8wB5/3ajfp7JaGo9MLyo25OPNTNIeo2WsYWZZ6wjUvGSlzd8FjMMdu4WXHU2KoUMo9Fkkk=`
which is:
```
NEO-GO-VM 0 > ops
INDEX    OPCODE       PARAMETER
0        PUSHT            <<
1        ASSERT
2        PUSHDATA1    c3f33055425a1a8f4cb08d4bc648f459249
```

Verification script:
`DCEDzfbXTXxymUH2d9SQNI8aYHgF4wZ2xi6MTYCqM7cw+dBBVuezJw==`
which is:
```
NEO-GO-VM 0 > ops
INDEX    OPCODE       PARAMETER
0        PUSHDATA1    03cdf6d740676c62e8c4d80aa33b730f9d0    <<
35       SYSCALL      System.Crypto.CheckSig (56e7b327)
```

As you can see, verification script has the form of standard signature
contract, and invocation script is just some side VM script that should
be properly executed to check transaction's witness. The problem is that
VerifyStateIndependent treats this invocation script as invalid and
aborts transaction witness verification.

Solution:
Check if Invocation witness script matches the expected standard
SignatureContract or MultiSigContract witness. If not, then do not
consider this witness as "standard".

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>

* Transaction: rename IsSingleSignature and IsSingleSignatures

No functional changes.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>

* Transaction: adjust state dependent verification

Apply the same rule for standard witness detection as for state
independent verification.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>

* Transaction: use var keyword for variables declaration

No functional changes.

S... (continued)

6080 of 8826 branches covered (68.89%)

Branch coverage included in aggregate %.

28 of 28 new or added lines in 1 file covered. (100.0%)

4 existing lines in 2 files now uncovered.

22199 of 27255 relevant lines covered (81.45%)

127925.58 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

60.58
/src/Plugins/OracleService/Protocols/OracleHttpsProtocol.cs


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc