-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Dynamically adjust fees #1453
Conversation
@@ -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)); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
But we don't think it's a bad feature. |
close #1433.
Add FeeContract to adjust syscall fees and opcode prices.