Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CalculateNetworkFee #2920

Merged
merged 4 commits into from
Sep 29, 2023
Merged

Update CalculateNetworkFee #2920

merged 4 commits into from
Sep 29, 2023

Conversation

belane
Copy link
Member

@belane belane commented Sep 27, 2023

Adjust the calculation of gas used during the verification.

@shargon shargon mentioned this pull request Sep 27, 2023
@belane
Copy link
Member Author

belane commented Sep 27, 2023

@dotnet-policy-service agree company="Belane"

shargon
shargon previously approved these changes Sep 27, 2023
@shargon shargon requested a review from superboyiii September 27, 2023 14:57
@@ -596,6 +596,7 @@ public long CalculateNetworkFee(DataCache snapshot, Transaction tx)
uint exec_fee_factor = NativeContract.Policy.GetExecFeeFactor(snapshot);
long networkFee = 0;
int index = -1;
long gas_left = ApplicationEngine.TestModeGas;
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't it be settings.MaxGasInvoke for consistency with invoke* RPC calls? Or maybe the minimum of two values?

Copy link
Member

Choose a reason for hiding this comment

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

OK, settings.MaxGasInvoke is unreachable from the Wallet class, so resolved.

Copy link
Contributor

Choose a reason for hiding this comment

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

Likely this can be solved with some API extension, a bit more invasive though.

@roman-khimov
Copy link
Contributor

Likely a bit better this way: nspcc-dev/neo-go#3141

Copy link
Member

@vncoelho vncoelho left a comment

Choose a reason for hiding this comment

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

HI @belane, good to see you again.

This is just verification, right?
In this sense, no change in case of resync, yes?

@belane
Copy link
Member Author

belane commented Sep 27, 2023

HI @belane, good to see you again.

This is just verification, right? In this sense, no change in case of resync, yes?

Hi @vncoelho , yes it's only for CalculateNetworkFee. It does not affect chain and doesn't need any resync.

@vncoelho
Copy link
Member

Sometimes need a re-sync is different than being affected by a future re-sync....Just to be sure...aehauhea

@shargon shargon merged commit 0e9cb9f into master Sep 29, 2023
@shargon shargon deleted the calculate-gasleft branch September 29, 2023 17:03
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.

5 participants