Skip to content

Update CalculateNetworkFee#2920

Merged
shargon merged 4 commits intomasterfrom
calculate-gasleft
Sep 29, 2023
Merged

Update CalculateNetworkFee#2920
shargon merged 4 commits intomasterfrom
calculate-gasleft

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
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