Skip to content

Commit 6a34a54

Browse files
authored
Set BUILDER_WITHDRAWAL_PREFIX to 0xB0 (#5416)
This changes the (temporary) withdrawal prefix used onboard builders at the Gloas fork from 0x03 to 0xB0. The rationale for this change is that it's further away from a realistic value which may be used in the future. This was a popular change and I'm unaware of anyone that is against it.
1 parent 720ec5b commit 6a34a54

5 files changed

Lines changed: 29 additions & 28 deletions

File tree

specs/gloas/beacon-chain.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ future validator withdrawal prefix may reuse this value.
182182

183183
| Name | Value |
184184
| --------------------------- | ---------------- |
185-
| `BUILDER_WITHDRAWAL_PREFIX` | `Bytes1('0x03')` |
185+
| `BUILDER_WITHDRAWAL_PREFIX` | `Bytes1('0xB0')` |
186186

187187
### Builder versions
188188

specs/gloas/builder.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,12 @@ must include:
5151
under `DOMAIN_BUILDER_DEPOSIT`.
5252

5353
*Note*: Builders may be onboarded at the fork by submitting a deposit to the
54-
validator deposit contract with a `0x03` withdrawal credential. This must be
55-
done late enough that the deposit is still pending at the fork, but early enough
56-
that the slot in which the deposit is added to the pending deposit queue is
57-
finalized so that the builder is considered active. Such a deposit signs over
58-
`DepositMessage` under `DOMAIN_DEPOSIT`, with withdrawal credentials of the form
54+
validator deposit contract with a `BUILDER_WITHDRAWAL_PREFIX` withdrawal
55+
credential. This must be done late enough that the deposit is still pending at
56+
the fork, but early enough that the slot in which the deposit is added to the
57+
pending deposit queue is finalized so that the builder is considered active.
58+
Such a deposit signs over `DepositMessage` under `DOMAIN_DEPOSIT`, with
59+
withdrawal credentials of the form
5960
`BUILDER_WITHDRAWAL_PREFIX + b"\x00" * 11 + execution_address`.
6061

6162
### Process deposit

tests/core/pyspec/eth_consensus_specs/test/gloas/block_processing/test_process_builder_deposit_request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def test_process_builder_deposit_request__top_up(spec, state):
275275
276276
Input State Configured:
277277
- Existing builder pubkey
278-
- Builder withdrawal credentials (0x03 prefix)
278+
- Builder withdrawal credentials
279279
280280
Output State Verified:
281281
- Builder balance increased (top-up)

tests/core/pyspec/eth_consensus_specs/test/gloas/block_processing/test_process_deposit_request.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ def test_process_deposit_request__builder_credentials_queued(spec, state):
2121
2222
Input State Configured:
2323
- New pubkey (not an existing validator or builder)
24-
- Builder withdrawal credentials (0x03 prefix)
24+
- Builder withdrawal credentials
2525
2626
Output State Verified:
2727
- Pending deposit added to the validator queue
2828
- No builder created (builder count unchanged)
2929
"""
3030
amount = spec.MIN_DEPOSIT_AMOUNT
31-
# Builder withdrawal credentials (0x03 prefix) on an otherwise ordinary deposit
31+
# Builder withdrawal credentials on an otherwise ordinary deposit
3232
withdrawal_credentials = spec.BUILDER_WITHDRAWAL_PREFIX + b"\x00" * 11 + b"\x59" * 20
3333
deposit_request = prepare_process_deposit_request(
3434
spec,
@@ -60,14 +60,14 @@ def test_process_deposit_request__builder_pubkey_queued(spec, state):
6060
6161
Input State Configured:
6262
- Existing builder pubkey
63-
- Builder withdrawal credentials (0x03 prefix)
63+
- Builder withdrawal credentials
6464
6565
Output State Verified:
6666
- Pending deposit added to the validator queue
6767
- Builder unchanged (no top-up)
6868
"""
6969
amount = spec.MIN_DEPOSIT_AMOUNT
70-
# Deposit for a pubkey that is already a builder, with builder (0x03) credentials
70+
# Deposit for a pubkey that is already a builder, with builder credentials
7171
builder_pubkey = state.builders[0].pubkey
7272
withdrawal_credentials = spec.BUILDER_WITHDRAWAL_PREFIX + b"\x00" * 11 + b"\x59" * 20
7373
deposit_request = prepare_process_deposit_request(

tests/core/pyspec/eth_consensus_specs/test/gloas/fork/test_gloas_fork_onboard_builders.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,8 @@ def test_fork_builder_deposit_with_existing_validator_pubkey_builder_creds(spec,
398398
def test_fork_builder_deposit_followed_by_non_builder_credentials(spec, phases, state):
399399
"""
400400
Test fork with two deposits for the same builder pubkey:
401-
- First deposit has builder credentials (0x03)
402-
- Second deposit has non-builder credentials (0x02)
401+
- First deposit has builder credentials
402+
- Second deposit has non-builder credentials
403403
Both should be applied to the builder.
404404
"""
405405
post_spec = phases[GLOAS]
@@ -408,7 +408,7 @@ def test_fork_builder_deposit_followed_by_non_builder_credentials(spec, phases,
408408
builder_pubkey = builder_pubkeys[0]
409409
privkey = builder_pubkey_to_privkey[builder_pubkey]
410410

411-
# First deposit: builder credentials (0x03)
411+
# First deposit: builder credentials
412412
builder_deposit = create_pending_deposit_for_builder(post_spec, builder_pubkey, amount)
413413

414414
# Second deposit: compounding credentials (0x02) for the same pubkey
@@ -453,8 +453,8 @@ def test_fork_builder_deposit_followed_by_non_builder_credentials(spec, phases,
453453
def test_fork_validator_deposit_followed_by_builder_credentials(spec, phases, state):
454454
"""
455455
Test fork with two deposits for the same pubkey:
456-
- First deposit has validator credentials (0x02)
457-
- Second deposit has builder credentials (0x03)
456+
- First deposit has validator credentials
457+
- Second deposit has builder credentials
458458
Both deposits should stay in pending (no builder created).
459459
"""
460460
post_spec = phases[GLOAS]
@@ -483,7 +483,7 @@ def test_fork_validator_deposit_followed_by_builder_credentials(spec, phases, st
483483
slot=post_spec.GENESIS_SLOT,
484484
)
485485

486-
# Second deposit: builder credentials (0x03) for the same pubkey
486+
# Second deposit: builder credentials for the same pubkey
487487
builder_deposit = create_pending_deposit_for_builder(post_spec, builder_pubkey, amount)
488488

489489
state.pending_deposits = [validator_deposit, builder_deposit]
@@ -513,8 +513,8 @@ def test_fork_validator_deposit_followed_by_builder_credentials(spec, phases, st
513513
def test_fork_invalid_validator_deposit_followed_by_builder_credentials(spec, phases, state):
514514
"""
515515
Test fork with two deposits for the same pubkey:
516-
- First deposit has validator credentials (0x02) but INVALID signature
517-
- Second deposit has builder credentials (0x03) with valid signature
516+
- First deposit has validator credentials but INVALID signature
517+
- Second deposit has builder credentials with valid signature
518518
The invalid validator deposit should not block the builder deposit.
519519
"""
520520
post_spec = phases[GLOAS]
@@ -534,7 +534,7 @@ def test_fork_invalid_validator_deposit_followed_by_builder_credentials(spec, ph
534534
slot=post_spec.GENESIS_SLOT,
535535
)
536536

537-
# Second deposit: builder credentials (0x03) with valid signature
537+
# Second deposit: builder credentials with valid signature
538538
builder_deposit = create_pending_deposit_for_builder(post_spec, builder_pubkey, amount)
539539

540540
state.pending_deposits = [invalid_validator_deposit, builder_deposit]
@@ -561,8 +561,8 @@ def test_fork_invalid_validator_deposit_followed_by_builder_credentials(spec, ph
561561
def test_fork_invalid_builder_deposit_followed_by_valid_builder_deposit(spec, phases, state):
562562
"""
563563
Test fork with two builder deposits for the same pubkey:
564-
- First deposit has builder credentials (0x03) but INVALID signature
565-
- Second deposit has builder credentials (0x03) with valid signature
564+
- First deposit has builder credentials but INVALID signature
565+
- Second deposit has builder credentials with valid signature
566566
The valid second deposit should create the builder.
567567
"""
568568
post_spec = phases[GLOAS]
@@ -571,7 +571,7 @@ def test_fork_invalid_builder_deposit_followed_by_valid_builder_deposit(spec, ph
571571
builder_pubkey = builder_pubkeys[0]
572572
builder_withdrawal_credentials = get_builder_withdrawal_credentials(post_spec, builder_pubkey)
573573

574-
# First deposit: builder credentials (0x03) with INVALID signature
574+
# First deposit: builder credentials with INVALID signature
575575
invalid_builder_deposit = post_spec.PendingDeposit(
576576
pubkey=builder_pubkey,
577577
withdrawal_credentials=builder_withdrawal_credentials,
@@ -580,7 +580,7 @@ def test_fork_invalid_builder_deposit_followed_by_valid_builder_deposit(spec, ph
580580
slot=post_spec.GENESIS_SLOT,
581581
)
582582

583-
# Second deposit: builder credentials (0x03) with valid signature
583+
# Second deposit: builder credentials with valid signature
584584
valid_builder_deposit = create_pending_deposit_for_builder(post_spec, builder_pubkey, amount)
585585

586586
state.pending_deposits = [invalid_builder_deposit, valid_builder_deposit]
@@ -604,8 +604,8 @@ def test_fork_invalid_builder_deposit_followed_by_valid_builder_deposit(spec, ph
604604
def test_fork_valid_builder_deposit_followed_by_invalid_builder_deposit(spec, phases, state):
605605
"""
606606
Test fork with two builder deposits for the same pubkey:
607-
- First deposit has builder credentials (0x03) with valid signature
608-
- Second deposit has builder credentials (0x03) but INVALID signature
607+
- First deposit has builder credentials with valid signature
608+
- Second deposit has builder credentials but INVALID signature
609609
The valid first deposit should create the builder, second adds to balance.
610610
"""
611611
post_spec = phases[GLOAS]
@@ -614,10 +614,10 @@ def test_fork_valid_builder_deposit_followed_by_invalid_builder_deposit(spec, ph
614614
builder_pubkey = builder_pubkeys[0]
615615
builder_withdrawal_credentials = get_builder_withdrawal_credentials(post_spec, builder_pubkey)
616616

617-
# First deposit: builder credentials (0x03) with valid signature
617+
# First deposit: builder credentials with valid signature
618618
valid_builder_deposit = create_pending_deposit_for_builder(post_spec, builder_pubkey, amount)
619619

620-
# Second deposit: builder credentials (0x03) with INVALID signature
620+
# Second deposit: builder credentials with INVALID signature
621621
invalid_builder_deposit = post_spec.PendingDeposit(
622622
pubkey=builder_pubkey,
623623
withdrawal_credentials=builder_withdrawal_credentials,

0 commit comments

Comments
 (0)