-
Notifications
You must be signed in to change notification settings - Fork 645
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
Contract rewards #1258
Contract rewards #1258
Conversation
6370c46
to
0f0a57e
Compare
@nearmax pointed out that the given change is likely going to slow down WASM execution because |
Refunds are free, meaining no gas cost to create/send or execute. Return burnt_gas as part of TransactionResult. Fixing tests by fixing tests. Increase fees 10X to properly check rewards.
Introduce execution rewards for every burnt_gas. |
|| (new_burnt_gas < self.config.max_gas_burnt | ||
&& new_used_gas < self.context.prepaid_gas) | ||
if new_burnt_gas <= self.config.max_gas_burnt | ||
&& (self.context.free_of_charge || new_used_gas <= self.context.prepaid_gas) |
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.
Also moving free_of_charge post max_gas_burnt
limit to avoid infinite loops with view calls.
@@ -638,10 +674,10 @@ impl Runtime { | |||
deposit_refund += gas_balance_refund; | |||
gas_balance_refund = 0; | |||
} | |||
if deposit_refund > 0 && &receipt.predecessor_id != &system_account() { | |||
if deposit_refund > 0 { |
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.
Why is not needed anymore?
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.
generate_refund_receipts
is now only called if predecessor_id
is not system.
} | ||
TransactionResult { | ||
status: TransactionStatus::Completed, | ||
logs: vec![], |
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.
what happens to the logs
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.
SignedTransaction verification doesn't generate logs. The are later generated by receipts.
Fixes #1179