builder demotion for block validation errors (#283)#315
builder demotion for block validation errors (#283)#315tosynthegeek wants to merge 1 commit intogattaca-com:developfrom
Conversation
| self.forks.get(parent_hash).and_then(|s| s.curr_bid.as_ref().map(|b| b.1.block_hash)) | ||
| } | ||
|
|
||
| pub fn get_builder_pub_key(&self, parent_hash: &B256) -> Option<BlsPublicKeyBytes> { |
There was a problem hiding this comment.
the builder pubkey should be already in the "local" payload we have in the payload entry, if not let's add it there instead of getting it from the bid sorter
There was a problem hiding this comment.
the builder pubkey should be already in the "local" payload we have in the payload entry, if not let's add it there instead of getting it from the bid sorter
Okay I will add builder_pubkey to PayloadEntry and pass it through to handle_get_payload, but since new_gossip payloads may not include a builder key, I may have to keep it as optional
There was a problem hiding this comment.
the builder pubkey should be already in the "local" payload we have in the payload entry, if not let's add it there instead of getting it from the bid sorter
Okay I will add
builder_pubkeytoPayloadEntryand pass it through tohandle_get_payload, but sincenew_gossippayloads may not include a builder key, I may have to keep it as optional
@ltitanb please let me know
crates/relay/src/auctioneer/types.rs
Outdated
| pub to_publish: VersionedSignedProposal, | ||
| pub trace: GetPayloadTrace, | ||
| pub fork: ForkName, | ||
| pub builder_pubkey: Option<BlsPublicKeyBytes>, |
| error!( | ||
| %builder_pubkey, | ||
| %err, | ||
| %block_hash_clone, | ||
| "failed to demote builder in database! Pausing all optimistic submissions" | ||
| ); |
There was a problem hiding this comment.
here you are not really pausing submission right? this is a copy of the demotion logic in handle_simulation_result however id rather we keep the demotion in one place. Let's make a new event , "BuilderDemotion" to be sent to the auctioneer , and refactor the existing logic to be used by both that event and the handle_simulation_result
There was a problem hiding this comment.
here you are not really pausing submission right? this is a copy of the demotion logic in
handle_simulation_resulthowever id rather we keep the demotion in one place. Let's make a new event , "BuilderDemotion" to be sent to the auctioneer , and refactor the existing logic to be used by both that event and thehandle_simulation_result
Make sense, I will resume this once I get clarification from the first review
dd6c038 to
f9b3ff9
Compare
|
@ltitanb I’ve pushed the latest changes for this, please take a look when you can. |
|
Hello @ltitanb I saw that my PR now has merge conflicts. Before I spend time resolving them, I wanted to check if this PR is still needed or if there are any changes required on my side. Please let me know how you'd like me to proceed. Thanks! |
|
hey @tosynthegeek , yes apologies for the delay! If you could please resolve the branch conflicts then me and @Owen66 will review! |
- Introduced `BuilderDemotion` event to trigger when `BeaconClientError::BlockValidationFailed` occurs - Added `send_event` method to `AuctioneerHandle` for safe event dispatch using private auctioneer sender - Used `builder_pubkey` from payload bid data to identify the demoted builder - Implemented `handle_builder_demotion` in `Context` to process demotion events
Thanks for the update @ltitanb, I’ve resolved all merge conflicts and pushed the updated changes. Please let me know if anything else is needed. |
This PR addresses issue #283 by implementing builder demotion for
BlockValidationFailederrors (e.g., block hash mismatch). The changes ensure that the builder for the invalid block is demoted once per incident, using both cache (local_cache.demote_builder) and database (db.db_demote_builder) for immediate and persistent effects, respectively.Changes
builder_pubkey: Option<BlsPublicKeyBytes>toGetPayloadResultDatato pass the builder's public key frombid_sorter.get_builder_pub_key.handle_get_payloadto retrievebuilder_pubkeyfromForkStateusingparent_hash.ProposerApi::_get_payloadto demote builders onBlockValidationFailederrors afterMultiBeaconClient::publish_block.