Skip to content

Dynamically adjust fees #1453

Closed
bettybao1209 wants to merge 7 commits intoneo-project:masterfrom
bettybao1209:dynamic-fee
Closed

Dynamically adjust fees #1453
bettybao1209 wants to merge 7 commits intoneo-project:masterfrom
bettybao1209:dynamic-fee

Conversation

@bettybao1209
Copy link
Contributor

close #1433.

Add FeeContract to adjust syscall fees and opcode prices.

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

5 participants