Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
79dbe88
wip
james-prysm Mar 16, 2026
42fba9a
Merge branch 'develop' into validator-proposer-preferences
james-prysm Mar 17, 2026
1023558
Merge branch 'develop' into validator-proposer-preferences
james-prysm Mar 17, 2026
7f458ad
Merge branch 'develop' into validator-proposer-preferences
james-prysm Mar 17, 2026
e63490e
fixing proto now that it merged in
james-prysm Mar 17, 2026
555c9a5
merge helpers for efficiency
james-prysm Mar 17, 2026
5531004
fixing domain and self review
james-prysm Mar 18, 2026
acb841a
fixing unit test
james-prysm Mar 18, 2026
aee6527
self review and optimizations
james-prysm Mar 18, 2026
bbe7729
return early to avoid validator registration post gloas
james-prysm Mar 18, 2026
c63a1d6
making domain self contained
james-prysm Mar 18, 2026
c2e6102
Merge branch 'develop' into validator-proposer-preferences
james-prysm Mar 19, 2026
e2abdd4
api uses a request type instead
james-prysm Mar 19, 2026
caa83a5
changelog
james-prysm Mar 19, 2026
69f91b4
fixing unit test
james-prysm Mar 19, 2026
81a1b0d
terence's comments
james-prysm Mar 20, 2026
0a33919
adding additional tests
james-prysm Mar 20, 2026
6f3561a
fixing keymanager naming from terence's feedback
james-prysm Mar 20, 2026
37f248a
self review
james-prysm Mar 20, 2026
e14c3a5
Merge branch 'develop' into validator-proposer-preferences
james-prysm Mar 20, 2026
001e5b8
Merge branch 'develop' into validator-proposer-preferences
james-prysm Mar 23, 2026
06a0820
Merge branch 'develop' into validator-proposer-preferences
james-prysm Mar 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .ethspecify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ exceptions:
- ATTESTATION_TIMELINESS_INDEX#gloas
- BUILDER_INDEX_FLAG#gloas
- BUILDER_INDEX_SELF_BUILD#gloas
- DOMAIN_PROPOSER_PREFERENCES#gloas
- NUM_BLOCK_TIMELINESS_DEADLINES#gloas
- PTC_TIMELINESS_INDEX#gloas

Expand Down
7 changes: 6 additions & 1 deletion beacon-chain/rpc/eth/config/handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ func TestGetSpec(t *testing.T) {
var dptc [4]byte
copy(dptc[:], []byte{'0', '0', '0', '8'})
config.DomainPTCAttester = dptc
var dpp [4]byte
copy(dpp[:], []byte{'0', '0', '0', '9'})
config.DomainProposerPreferences = dpp
var dam [4]byte
copy(dam[:], []byte{'1', '0', '0', '0'})
config.DomainApplicationMask = dam
Expand All @@ -226,7 +229,7 @@ func TestGetSpec(t *testing.T) {
require.NoError(t, json.Unmarshal(writer.Body.Bytes(), &resp))
data, ok := resp.Data.(map[string]any)
require.Equal(t, true, ok)
assert.Equal(t, 197, len(data))
assert.Equal(t, 198, len(data))
for k, v := range data {
t.Run(k, func(t *testing.T) {
switch k {
Expand Down Expand Up @@ -438,6 +441,8 @@ func TestGetSpec(t *testing.T) {
assert.Equal(t, "0x30303037", v)
case "DOMAIN_PTC_ATTESTER":
assert.Equal(t, "0x30303038", v)
case "DOMAIN_PROPOSER_PREFERENCES":
assert.Equal(t, "0x30303039", v)
case "DOMAIN_APPLICATION_MASK":
assert.Equal(t, "0x31303030", v)
case "DOMAIN_SYNC_COMMITTEE":
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/verification/signed_proposer_preferences.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (v *ProposerPreferencesVerifier) VerifySignature(st state.ReadOnlyBeaconSta

msg := v.message()
epoch := slots.ToEpoch(msg.ProposalSlot)
domain, err := signing.Domain(st.Fork(), epoch, params.BeaconConfig().DomainBeaconProposer, st.GenesisValidatorsRoot())
domain, err := signing.Domain(st.Fork(), epoch, params.BeaconConfig().DomainProposerPreferences, st.GenesisValidatorsRoot())

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it should be this right?

if err != nil {
return errors.Wrap(err, "domain")
}
Expand Down
17 changes: 13 additions & 4 deletions beacon-chain/verification/signed_proposer_preferences_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func TestProposerPreferencesVerifier_VerifySignature(t *testing.T) {
verifier := &ProposerPreferencesVerifier{results: newResults(RequireProposerPreferencesSignatureValid), p: signed}
require.NoError(t, verifier.VerifySignature(st))

// Signature from the wrong key must fail.
badSig := signProposerPreferencesForState(t, keys[6], signed.Message, st)
signed.Signature = badSig
verifier = &ProposerPreferencesVerifier{results: newResults(RequireProposerPreferencesSignatureValid), p: signed}
Expand All @@ -52,8 +53,18 @@ func TestProposerPreferencesVerifier_VerifySignature(t *testing.T) {
func newSignedProposerPreferencesState(t *testing.T, currentSlot, proposalSlot primitives.Slot, validatorIndex primitives.ValidatorIndex) (state.BeaconState, []bls.SecretKey, *ethpb.SignedProposerPreferences) {
t.Helper()

params.SetupTestConfigCleanup(t)
cfg := params.BeaconConfig().Copy()
cfg.GloasForkEpoch = 0
params.OverrideBeaconConfig(cfg)

st, keys := util.DeterministicGenesisStateFulu(t, 64)
require.NoError(t, st.SetSlot(currentSlot))
require.NoError(t, st.SetFork(&ethpb.Fork{
PreviousVersion: cfg.FuluForkVersion,
CurrentVersion: cfg.GloasForkVersion,
Epoch: 0,
}))

lookaheadSize := int(uint64(params.BeaconConfig().MinSeedLookahead+1) * uint64(params.BeaconConfig().SlotsPerEpoch))
lookahead := make([]primitives.ValidatorIndex, lookaheadSize)
Expand All @@ -77,9 +88,7 @@ func signProposerPreferencesForState(t *testing.T, sk bls.SecretKey, preferences
t.Helper()

epoch := slots.ToEpoch(preferences.ProposalSlot)
domain, err := signing.Domain(st.Fork(), epoch, params.BeaconConfig().DomainBeaconProposer, st.GenesisValidatorsRoot())
require.NoError(t, err)
root, err := signing.ComputeSigningRoot(preferences, domain)
sig, err := signing.ComputeDomainAndSign(st, epoch, preferences, params.BeaconConfig().DomainProposerPreferences, sk)
require.NoError(t, err)
return sk.Sign(root[:]).Marshal()
return sig
}
3 changes: 3 additions & 0 deletions changelog/james-prysm_validator-proposer-preferences.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Added

- proposer preferences call from validator client for gloas.
1 change: 1 addition & 0 deletions config/params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ type BeaconChainConfig struct {
DomainBLSToExecutionChange [4]byte `yaml:"DOMAIN_BLS_TO_EXECUTION_CHANGE" spec:"true"` // DomainBLSToExecutionChange defines the BLS signature domain to change withdrawal addresses to ETH1 prefix
DomainBeaconBuilder [4]byte `yaml:"DOMAIN_BEACON_BUILDER" spec:"true"` // DomainBeaconBuilder defines the BLS signature domain for beacon block builder.
DomainPTCAttester [4]byte `yaml:"DOMAIN_PTC_ATTESTER" spec:"true"` // DomainPTCAttester defines the BLS signature domain for payload transaction committee attester.
DomainProposerPreferences [4]byte `yaml:"DOMAIN_PROPOSER_PREFERENCES" spec:"true"` // DomainProposerPreferences defines the BLS signature domain for proposer preferences.

// Prysm constants.
GenesisValidatorsRoot [32]byte // GenesisValidatorsRoot is the root hash of the genesis validators.
Expand Down
1 change: 1 addition & 0 deletions config/params/mainnet_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ var mainnetBeaconConfig = &BeaconChainConfig{
DomainBLSToExecutionChange: bytesutil.Uint32ToBytes4(0x0A000000),
DomainBeaconBuilder: bytesutil.Uint32ToBytes4(0x0B000000),
DomainPTCAttester: bytesutil.Uint32ToBytes4(0x0C000000),
DomainProposerPreferences: bytesutil.Uint32ToBytes4(0x0D000000),

// Prysm constants.
GenesisValidatorsRoot: [32]byte{75, 54, 61, 185, 78, 40, 97, 32, 215, 110, 185, 5, 52, 15, 221, 78, 84, 191, 233, 240, 107, 243, 63, 246, 207, 90, 210, 127, 81, 27, 254, 149},
Expand Down
Loading
Loading