-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Fee Recipient: CLI flags and Calling Beacon API (#10312)
* send proposer data to config * wip implementation with file and url based config import * improving logic on get validator index * fix function * optimizing function for map and address bug * fixing log * update cache if it doesn't exist * updating flags * initial unit test scaffold * fixing validator to call rpc call, removed temporary dependency * adding the API calls for the runner * fixing broken build * fixing deepsource * fixing interface * fixing fatal * fixing more deepsource issues * adding test placeholders * updating proposer config to add validation * changing how if statement throws error * removing unneeded validation, validating in a different way * wip improving tests * more unit test work * fixing unit test * fixing unit tests and edge cases * adding unit tests and adjusting how the config is created * fixing bazel builds * fixing proto generation * fixing imports * fixing unit tests * Update cmd/validator/flags/flags.go Co-authored-by: Raul Jordan <[email protected]> * updating flags based on comments, fixing unit tests * fixing bazel * removing unneeded function * fixing unit tests * refactors and unit test fixes based on comments * fixing bazel build * refactor the cache out fo the fee recipient function * adding usecase for multiple fee recipient * refactor burn name * Update validator/client/validator.go Co-authored-by: Raul Jordan <[email protected]> * Update validator/client/validator.go Co-authored-by: Raul Jordan <[email protected]> * Update validator/client/validator.go Co-authored-by: Raul Jordan <[email protected]> * fixing bug with validator index based on code review * edited flag descriptions to better communicate usage * fixing manual reference to flag name * fixing code review comments * fixing linting * Update validator/client/validator.go Co-authored-by: Raul Jordan <[email protected]> * addressing comments and renaming functions * fixing linting * Update cmd/validator/flags/flags.go * Update cmd/validator/flags/flags.go * Update cmd/validator/flags/flags.go * improving comments Co-authored-by: Raul Jordan <[email protected]>
- Loading branch information
1 parent
dc527a3
commit df8da80
Showing
26 changed files
with
1,270 additions
and
426 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
load("@prysm//tools/go:def.bzl", "go_library") | ||
|
||
go_library( | ||
name = "go_default_library", | ||
srcs = ["fee-recipient-config.go"], | ||
importpath = "github.com/prysmaticlabs/prysm/config/validator/service", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//config/fieldparams:go_default_library", | ||
"@com_github_ethereum_go_ethereum//common:go_default_library", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package validator_service_config | ||
|
||
import ( | ||
"github.com/ethereum/go-ethereum/common" | ||
field_params "github.com/prysmaticlabs/prysm/config/fieldparams" | ||
) | ||
|
||
// FeeRecipientFileConfig is the struct representation of the JSON config file set in the validator through the CLI. | ||
// ProposeConfig is the map of validator address to fee recipient options all in hex format. | ||
// DefaultConfig is the default fee recipient address for all validators unless otherwise specified in the propose config.required. | ||
type FeeRecipientFileConfig struct { | ||
ProposeConfig map[string]*FeeRecipientFileOptions `json:"proposer_config"` | ||
DefaultConfig *FeeRecipientFileOptions `json:"default_config"` | ||
} | ||
|
||
// FeeRecipientFileOptions is the struct representation of the JSON config file set in the validator through the CLI. | ||
// FeeRecipient is set to an eth address in hex string format with 0x prefix. | ||
type FeeRecipientFileOptions struct { | ||
FeeRecipient string `json:"fee_recipient"` | ||
} | ||
|
||
// FeeRecipientConfig is a Prysm internal representation of the fee recipient config on the validator client. | ||
// FeeRecipientFileConfig maps to FeeRecipientConfig on import through the CLI. | ||
type FeeRecipientConfig struct { | ||
ProposeConfig map[[field_params.BLSPubkeyLength]byte]*FeeRecipientOptions | ||
DefaultConfig *FeeRecipientOptions | ||
} | ||
|
||
// FeeRecipientOptions is a Prysm internal representation of the FeeRecipientFileOptions on the validator client in bytes format instead of hex. | ||
type FeeRecipientOptions struct { | ||
FeeRecipient common.Address | ||
} |
Oops, something went wrong.