Skip to content

Limit calculatenetworkfee GAS#3141

Merged
roman-khimov merged 2 commits intomasterfrom
limit-calculatenetworkfee-gas
Sep 28, 2023
Merged

Limit calculatenetworkfee GAS#3141
roman-khimov merged 2 commits intomasterfrom
limit-calculatenetworkfee-gas

Conversation

@roman-khimov
Copy link
Member

No description provided.

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>
@roman-khimov roman-khimov added bug Something isn't working rpc RPC server and client labels Sep 27, 2023
@roman-khimov roman-khimov added this to the v0.102.1 milestone Sep 27, 2023
@codecov
Copy link

codecov bot commented Sep 27, 2023

Codecov Report

Merging #3141 (49a44b0) into master (3628b82) will decrease coverage by 0.03%.
The diff coverage is 71.42%.

@@            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     
Files Coverage Δ
pkg/services/rpcsrv/server.go 80.85% <71.42%> (-0.08%) ⬇️

... and 3 files with indirect coverage changes

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

Copy link
Member

@AnnaShaleva AnnaShaleva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The gas limit fix LGTM.

@roman-khimov roman-khimov merged commit 4598f3d into master Sep 28, 2023
@roman-khimov roman-khimov deleted the limit-calculatenetworkfee-gas branch September 28, 2023 06:13
// Verification GAS cost can't exceed this policy.
gasLimit = s.chain.GetMaxVerificationGAS()
)
if gasLimit > int64(s.config.MaxGasInvoke) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename gasLimit? The gasLimit is only for the execution cost, it would be exceeded by the size of the transaction (for example).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working rpc RPC server and client

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants