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

Add multiple withdrawal addresses to cluster-definition #1645

Closed
dB2510 opened this issue Jan 17, 2023 · 0 comments
Closed

Add multiple withdrawal addresses to cluster-definition #1645

dB2510 opened this issue Jan 17, 2023 · 0 comments
Assignees
Labels
protocol Protocol Team tickets

Comments

@dB2510
Copy link
Contributor

dB2510 commented Jan 17, 2023

Problem to be solved

We want to allow our users to add different withdrawal address & fee-recipient address corresponding to each validator public key. Currently, we use withdrawal_address & fee_recipient_address fields of cluster-definition for all the validators.

Proposed solution

Add a validators nested top level field to the cluster-definition as an array of objects with two fields, withdrawal_address & fee_recipient_address. Also remove current withdrawal_address & fee_recipient_address fields in cluster-definition.

"validators": [
    {
      "fee_recipient_address": "0x52fdfc072182654f163f5f0f9a621d729566c74d",
      "withdrawal_address": "0x81855ad8681d0d86d1e91e00167939cb6694d2c4"
    },
    {
      "fee_recipient_address": "0xf5059875921e668a5bdf2c7fc4844592d2572bcd",
      "withdrawal_address": "0xa3b539eb1e5849c6077dbb5722f5717a289a266f"
    }
  ]

The withdrawal_address & fee_recipient_address fields in validators are exactly the same as the current withdrawal_address & fee_recipient_address fields.

This is part of new draft version v1.5.0.

The validators field will be included in config_hash calculation.

Check len(definition.Validators) == definition.NumValidators.

The ssz spec:

type Definition struct {
	// UUID is a human-readable random unique identifier. Max 64 chars.
	UUID string `json:"uuid" ssz:"ByteList[64]" config_hash:"0" definition_hash:"0"`

	// Name is a human-readable cosmetic identifier. Max 256 chars.
	Name string `json:"name" ssz:"ByteList[256]" config_hash:"1" definition_hash:"1"`

	// Version is the schema version of this definition. Max 16 chars.
	Version string `json:"version" ssz:"ByteList[16]" config_hash:"2" definition_hash:"2"`

	// Timestamp is the human-readable timestamp of this definition. Max 32 chars.
	// Note that this was added in v1.1.0, so may be empty for older versions.
	Timestamp string `json:"timestamp" ssz:"ByteList[32]" config_hash:"3" definition_hash:"3"`

	// NumValidators is the number of DVs (n*32ETH) to be created in the cluster lock file.
	NumValidators int `json:"num_validators" ssz:"uint64" config_hash:"4" definition_hash:"4"`

	// Threshold required for signature reconstruction. Defaults to safe value for number of nodes/peers.
	Threshold int `json:"threshold" ssz:"uint64" config_hash:"5" definition_hash:"5"`

	// FeeRecipientAddress 20 byte Ethereum address. Deprecated: use Validators instead.
	FeeRecipientAddress string `json:"fee_recipient_address,0xhex" ssz:"Bytes20" config_hash:"6" definition_hash:"6"`

	// WithdrawalAddress 20 byte Ethereum address. Deprecated: use Validators instead.
	WithdrawalAddress string `json:"withdrawal_address,0xhex" ssz:"Bytes20" config_hash:"7" definition_hash:"7"`

	// DKGAlgorithm to use for key generation. Max 32 chars.
	DKGAlgorithm string `json:"dkg_algorithm" ssz:"ByteList[32]" config_hash:"8" definition_hash:"8"`

	// ForkVersion defines the cluster's 4 byte beacon chain fork version (network/chain identifier).
	ForkVersion []byte `json:"fork_version,0xhex" ssz:"Bytes4" config_hash:"9" definition_hash:"9"`

	// Operators define the charon nodes in the cluster and their operators. Max 256 operators.
	Operators []Operator `json:"operators" ssz:"CompositeList[256]" config_hash:"10" definition_hash:"10"`

	// Creator identifies the creator of a cluster definition. They may also be an operator.
	Creator Creator `json:"creator" ssz:"Composite" config_hash:"11" definition_hash:"11"`

	// Validators define the configuration required by each cluster validator.
	Validators []Validator `json:"validators" ssz:"CompositeList[65536]" config_hash:"12" definition_hash:"12"`

	// ConfigHash uniquely identifies a cluster definition excluding operator ENRs and signatures.
	ConfigHash []byte `json:"config_hash,0xhex" ssz:"Bytes32" config_hash:"-" definition_hash:"13"`

	// DefinitionHash uniquely identifies a cluster definition including operator ENRs and signatures.
	DefinitionHash []byte `json:"definition_hash,0xhex" ssz:"Bytes32" config_hash:"-" definition_hash:"-"`
}

// Validator identifies the validator run by the cluster.
type Validator struct {
	// FeeRecipientAddress 20 byte Ethereum address.
	FeeRecipientAddress string `json:"fee_recipient_address,0xhex" ssz:"Bytes20" config_hash:"0" definition_hash:"0"`

	// WithdrawalAddress 20 byte Ethereum address.
	WithdrawalAddress string `json:"withdrawal_address,0xhex" ssz:"Bytes20" config_hash:"1" definition_hash:"1"`
}

Out of Scope

Only release v1.5 once launchpad has been upgraded, tested and everything works. Using these fields is out of scope.

@dB2510 dB2510 added this to the M1 Guarded Launch milestone Jan 17, 2023
@thomasheremans thomasheremans added the protocol Protocol Team tickets label Jan 23, 2023
obol-bulldozer bot pushed a commit that referenced this issue Jan 24, 2023
Adds a new 1.5 cluster definition version with individual fee recipients and withdrawal addresses per validator. This PR is only to add these fields, not use them for now.

category: feature
ticket: #1645
obol-bulldozer bot pushed a commit that referenced this issue Jan 24, 2023
Fixes lint. 

category: fixbuild
ticket: #1645
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
protocol Protocol Team tickets
Projects
None yet
Development

No branches or pull requests

3 participants