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

CIP-28: Split etherbase into validator & txFeeRecipient addresses #1195

Merged
merged 47 commits into from
Jan 29, 2021

Conversation

andres-dg
Copy link
Contributor

@andres-dg andres-dg commented Oct 26, 2020

Description

Implementation for CIP-28.

We separate the coinbase address role into two roles: validator and txFeeRecipient. The validator address will receive validation rewards, while the txFeeRecipient address will receive transaction fees. The terms etherbase and coinbase become aliases for the txFeeRecipient address.

Both parameters are set via command line
New flags:
miner.validator is the validator address
txFeeRecipient the address where all the fees payments will be transferred
If one of these flags is present, the other will be required, even if it is the same address, to force a conscious decision about it

To maintain backwards compatibility, the etherbase flag if is already set, and non of the other two flags were set, it will fill that address as the miner.validator and the txFeeRecipient. The flag will eventually be deprecated.

We changed the default behaviour of the etherbase flag. Now it won't assume the first account of the keyStore as default. So beware. Either the etherbase flag or the pair miner.validator and txFeeRecipient MUST be set.

Other changes

Split etherbase in ethstats.

Related issues

Backwards compatibility

Hardfork Change. Modifies block validation logic. Part of Donut Hardfork

cmd/utils/flags.go Outdated Show resolved Hide resolved
miner/worker.go Outdated Show resolved Hide resolved
eth/gen_config.go Outdated Show resolved Hide resolved
@mcortesi mcortesi changed the title andres-dg/split-etherbase Split etherbase into validator & txFeeRecipient addresses Dec 15, 2020
@mcortesi mcortesi changed the title Split etherbase into validator & txFeeRecipient addresses CIP-28: Split etherbase into validator & txFeeRecipient addresses Jan 12, 2021
core/state_processor.go Outdated Show resolved Hide resolved
core/vm/context.go Outdated Show resolved Hide resolved
cmd/utils/flags.go Outdated Show resolved Hide resolved
eth/backend.go Outdated Show resolved Hide resolved
@@ -456,7 +464,11 @@ func (w *worker) mainLoop() {
continue
}
w.mu.RLock()
coinbase := w.coinbase
txFeeRecipient := w.txFeeRecipient
if !w.chainConfig.IsDonut(w.current.header.Number) && w.txFeeRecipient != w.validator {
Copy link
Contributor

Choose a reason for hiding this comment

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

do we know if current.header != nil?

Copy link
Contributor

Choose a reason for hiding this comment

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

The only function that sets the current is makeCurrent, which is called only by the Prepare function after initialising the header.
I can't use the header.Coinbase in that line, because it's the case where the consensus is not running, and leaves the header.Coinbase with nil

Copy link
Contributor

@mcortesi mcortesi left a comment

Choose a reason for hiding this comment

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

Great Work1

@gastonponti gastonponti merged commit 008c055 into master Jan 29, 2021
@gastonponti gastonponti deleted the lucasege/separate-flags branch January 29, 2021 01:59
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.

Split Etherbase into GatewayFeeRecipient and Validator
5 participants