Merged
Conversation
We can ignore core.ErrInvalidSignature (which means that the script has executed, but returned false), but we shouldn't ignore other errors which likely mean that the script is incorrect (or hits some resource limits). Use neorpc.ErrInvalidSignature as a return to separate this case from contract-based verification. Signed-off-by: Roman Khimov <roman@nspcc.ru>
Valid transactions can't use more than MaxVerificationGAS for script execution and this applies to the whole set of signers, so use this value by default unless local instance configuration suggests something lower for generic invocations. Signed-off-by: Roman Khimov <roman@nspcc.ru>
Codecov Report
@@ Coverage Diff @@
## master #3141 +/- ##
==========================================
- Coverage 84.84% 84.82% -0.03%
==========================================
Files 330 330
Lines 44320 44332 +12
==========================================
+ Hits 37603 37604 +1
- Misses 5209 5216 +7
- Partials 1508 1512 +4
... and 3 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
AnnaShaleva
approved these changes
Sep 27, 2023
shargon
reviewed
Sep 28, 2023
| // Verification GAS cost can't exceed this policy. | ||
| gasLimit = s.chain.GetMaxVerificationGAS() | ||
| ) | ||
| if gasLimit > int64(s.config.MaxGasInvoke) { |
There was a problem hiding this comment.
Rename gasLimit? The gasLimit is only for the execution cost, it would be exceeded by the size of the transaction (for example).
Member
Author
There was a problem hiding this comment.
Naming is hard! At least it should do the trick even with this name.
AnnaShaleva
pushed a commit
that referenced
this pull request
Oct 4, 2023
Limit calculatenetworkfee GAS 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.
No description provided.