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

Gas payment change for audit issue M02 #885

Merged
merged 13 commits into from
Feb 27, 2020

Conversation

mrsmkl
Copy link
Contributor

@mrsmkl mrsmkl commented Feb 26, 2020

Description

Tx cost payments with non-gold were changed to minimize the number of emitted events and EVM contract calls.

Tested

The CI in monorepo is currently pointing here.

Other changes

Related issues

Backwards compatibility

Not backwards compatible with old contracts.

@asaj asaj self-assigned this Feb 26, 2020
core/state_transition.go Outdated Show resolved Hide resolved
core/state_transition.go Outdated Show resolved Hide resolved
core/state_transition.go Outdated Show resolved Hide resolved
core/state_transition.go Outdated Show resolved Hide resolved
core/state_transition.go Outdated Show resolved Hide resolved
params/protocol_params.go Outdated Show resolved Hide resolved
params/protocol_params.go Outdated Show resolved Hide resolved
params/protocol_params.go Outdated Show resolved Hide resolved
if err := st.creditFee(*st.msg.GatewayFeeRecipient(), st.msg.GatewayFee(), st.msg.FeeCurrency()); err != nil {
log.Error("Failed to credit gateway fee", "err", err)
return err
if feeCurrency == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

This section could probably be cleaned up

@asaj asaj assigned mcortesi and unassigned asaj Feb 26, 2020
@mcortesi mcortesi assigned asaj and unassigned mcortesi Feb 27, 2020
"coinbaseFeeRecipient", st.evm.Coinbase, "coinbaseFee", tipTxFee,
"comunityFundRecipient", *governanceAddress, "communityFundFee", baseTxFee)
if feeCurrency == nil {
if gatewayFeeRecipient != &common.ZeroAddress {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we refund the gateway fee in this case?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, since on payFees we don't debit it if st.msg doesn't have GatewayFeeRecipient

@asaj asaj assigned mrsmkl and mcortesi and unassigned asaj Feb 27, 2020
@kevjue kevjue merged commit 79c7471 into master Feb 27, 2020
@mcortesi mcortesi deleted the mrsmkl/gas-payment-change-m02-alt branch July 21, 2020 17:27
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.

4 participants