2022-06-06 19:32:41 +00:00
|
|
|
package validator_service_config
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/ethereum/go-ethereum/common"
|
2022-06-27 13:34:38 +00:00
|
|
|
fieldparams "github.com/prysmaticlabs/prysm/config/fieldparams"
|
2022-06-16 15:10:23 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/config/params"
|
2022-06-06 19:32:41 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// ProposerSettingsPayload is the struct representation of the JSON or YAML payload set in the validator through the CLI.
|
2022-06-30 00:24:39 +00:00
|
|
|
// ProposerConfig is the map of validator address to fee recipient options all in hex format.
|
2022-06-06 19:32:41 +00:00
|
|
|
// DefaultConfig is the default fee recipient address for all validators unless otherwise specified in the propose config.required.
|
|
|
|
type ProposerSettingsPayload struct {
|
2022-06-30 00:24:39 +00:00
|
|
|
ProposerConfig map[string]*ProposerOptionPayload `json:"proposer_config" yaml:"proposer_config"`
|
|
|
|
DefaultConfig *ProposerOptionPayload `json:"default_config" yaml:"default_config"`
|
2022-06-06 19:32:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// ProposerOptionPayload 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 ProposerOptionPayload struct {
|
2022-07-06 18:42:21 +00:00
|
|
|
FeeRecipient string `json:"fee_recipient" yaml:"fee_recipient"`
|
|
|
|
ValidatorRegistration *ValidatorRegistration `json:"validator_registration" yaml:"validator_registration"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// ValidatorRegistration is the struct representation of the JSON config file set in the validator through the CLI.
|
|
|
|
// GasLimit is a number set to help the network decide on the maximum gas in each block.
|
|
|
|
type ValidatorRegistration struct {
|
|
|
|
Enable bool `json:"enable" yaml:"enable"`
|
|
|
|
GasLimit uint64 `json:"gas_limit,omitempty" yaml:"gas_limit,omitempty"`
|
2022-06-06 19:32:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// ProposerSettings is a Prysm internal representation of the fee recipient config on the validator client.
|
|
|
|
// ProposerSettingsPayload maps to ProposerSettings on import through the CLI.
|
|
|
|
type ProposerSettings struct {
|
2022-06-27 13:34:38 +00:00
|
|
|
ProposeConfig map[[fieldparams.BLSPubkeyLength]byte]*ProposerOption
|
2022-06-06 19:32:41 +00:00
|
|
|
DefaultConfig *ProposerOption
|
|
|
|
}
|
|
|
|
|
|
|
|
// ProposerOption is a Prysm internal representation of the ProposerOptionPayload on the validator client in bytes format instead of hex.
|
|
|
|
type ProposerOption struct {
|
2022-07-06 18:42:21 +00:00
|
|
|
FeeRecipient common.Address
|
|
|
|
ValidatorRegistration *ValidatorRegistration
|
2022-06-06 19:32:41 +00:00
|
|
|
}
|
2022-06-16 15:10:23 +00:00
|
|
|
|
|
|
|
// DefaultProposerOption returns a Proposer Option with defaults filled
|
|
|
|
func DefaultProposerOption() ProposerOption {
|
|
|
|
return ProposerOption{
|
2022-07-06 18:42:21 +00:00
|
|
|
FeeRecipient: params.BeaconConfig().DefaultFeeRecipient,
|
|
|
|
ValidatorRegistration: nil,
|
2022-06-16 15:10:23 +00:00
|
|
|
}
|
|
|
|
}
|