proposer preference rest - #16835
Merged
Merged
Conversation
james-prysm
marked this pull request as ready for review
May 27, 2026 18:24
satushh
reviewed
May 28, 2026
| if !ok { | ||
| return errWrongMessage | ||
| } | ||
| s.cfg.operationNotifier.OperationFeed().Send(&feed.Event{ |
Member
There was a problem hiding this comment.
Should there be a nil check on operationNotifier ?
Contributor
Author
There was a problem hiding this comment.
no operationNotifier should be initialized at startup
syjn99
reviewed
Jun 2, 2026
syjn99
reviewed
Jun 3, 2026
Co-authored-by: Jun Song <87601811+syjn99@users.noreply.github.com>
# Conflicts: # api/server/structs/endpoints_events.go # beacon-chain/core/feed/operation/events.go # beacon-chain/rpc/eth/events/events.go # beacon-chain/rpc/eth/events/events_test.go
james-prysm
force-pushed
the
proposer-preference-rest
branch
from
June 8, 2026 14:37
e608b8c to
2340406
Compare
Co-authored-by: Jun Song <87601811+syjn99@users.noreply.github.com>
syjn99
approved these changes
Jun 8, 2026
Member
There was a problem hiding this comment.
LGTM.
Done some local testing with these:
Kurtosis config
PR description.
Submitting the preference
Modified validation function a bit: To ignore signature. (for building data conveniently)
Bash script to generate a `proposer_preferences.json`
BN=http://127.0.0.1:33113
SLOTS_PER_EPOCH=$(curl -s "$BN/eth/v1/config/spec" | jq -r '.data.SLOTS_PER_EPOCH')
GLOAS_FORK_EPOCH=$(curl -s "$BN/eth/v1/config/spec" | jq -r '.data.GLOAS_FORK_EPOCH')
HEAD_SLOT=$(curl -s "$BN/eth/v1/beacon/headers/head" | jq -r '.data.header.message.slot')
echo $BN
echo $SLOTS_PER_EPOCH
CUR_EPOCH=$((HEAD_SLOT / SLOTS_PER_EPOCH))
TARGET_EPOCH=$((CUR_EPOCH + 1))
if [ "$TARGET_EPOCH" -lt "$GLOAS_FORK_EPOCH" ]; then
echo "Too early: current epoch=$CUR_EPOCH, Gloas fork epoch=$GLOAS_FORK_EPOCH. Wait until epoch $((GLOAS_FORK_EPOCH - 1))."
exit 1
fi
DUTIES=$(curl -s "$BN/eth/v2/validator/duties/proposer/$TARGET_EPOCH")
DEPENDENT_ROOT=$(echo "$DUTIES" | jq -r '.dependent_root')
PROPOSAL_SLOT=$(echo "$DUTIES" | jq -r '.data[0].slot')
VALIDATOR_INDEX=$(echo "$DUTIES" | jq -r '.data[0].validator_index')
SIG="0x$(printf '00%.0s' {1..96})"
jq -n \
--arg dependent_root "$DEPENDENT_ROOT" \
--arg proposal_slot "$PROPOSAL_SLOT" \
--arg validator_index "$VALIDATOR_INDEX" \
--arg signature "$SIG" \
'[{
message: {
dependent_root: $dependent_root,
proposal_slot: $proposal_slot,
validator_index: $validator_index,
fee_recipient: "0x0000000000000000000000000000000000000000",
target_gas_limit: "30000000"
},
signature: $signature
}]' > proposer_preferences.jsonRequest with:
$ curl -i -X POST "$BN/eth/v1/validator/proposer_preferences" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Eth-Consensus-Version: gloas" \
--data @proposer_preferences.json
HTTP/1.1 200 OK
Vary: Origin
Date: Mon, 08 Jun 2026 17:10:12 GMT
Content-Length: 0proposer_preferences event:
$ curl -N "$BN/eth/v1/events?topics=proposer_preferences"Result:
event: proposer_preferences
data: {"version":"gloas","data":{"message":{"dependent_root":"0x4fbae0555738e07f528dd408dced944daf5998f3d4349889f5c65c0f4014fdb8","proposal_slot":"64","validator_index":"33","fee_recipient":"0x0000000000000000000000000000000000000000","target_gas_limit":"30000000"},"signature":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"}}
Note that the fee recipient becomes zero hash as I built the data.
Also checked with Dora.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
Feature
What does this PR do? Why is it needed?
proposer_preferencesSSE event topic on /eth/v1/eventskurtosis setup
depends on #16421 + adding some connection changes for ptc duties
for more perfect run otherwise you will see some orphans
Which issues(s) does this PR fix?
implements ethereum/beacon-APIs#608 changes
note: this pr does not implement deprecation or the get proposer preferences endpoint
Other notes for review
Acknowledgements