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

Dynamically adjust fees #1453

Closed
wants to merge 7 commits into from

Conversation

bettybao1209
Copy link
Contributor

close #1433.

Add FeeContract to adjust syscall fees and opcode prices.

@@ -87,7 +88,7 @@ protected override bool PreExecuteInstruction()
{
if (CurrentContext.InstructionPointer >= CurrentContext.Script.Length)
return true;
return AddGas(OpCodePrices[CurrentContext.CurrentInstruction.OpCode]);
return AddGas(NativeContract.Fee.GetOpCodePrice(CurrentContext.CurrentInstruction.OpCode, Snapshot));
Copy link
Member

Choose a reason for hiding this comment

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

We should use GetRatio only, otherwise we will lose a big performance, other way is caching the prices, and refresh this cache when it's needed.

Copy link
Contributor

Choose a reason for hiding this comment

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

We're concerned that some instructions' cost may be too high, which may need to be adjusted in the future.

@erikzhang erikzhang closed this Feb 25, 2020
@Tommo-L
Copy link
Contributor

Tommo-L commented Feb 26, 2020

But we don't think it's a bad feature.

@Tommo-L Tommo-L mentioned this pull request Mar 16, 2020
@bettybao1209 bettybao1209 deleted the dynamic-fee branch March 17, 2020 06:24
@Qiao-Jin Qiao-Jin mentioned this pull request Oct 28, 2020
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.

Reduce transaction fees
4 participants