Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR makes the delivered payload optional in the historical data fetching process. It adds a configuration option to allow fallback behavior when payload delivery information cannot be retrieved from relays.
- Added a configurable flag
require_delivered_payload_from_relaysto control whether payload delivery is mandatory - Implemented fallback logic that generates a fake delivered payload when relay data is unavailable
- Added error handling and warning logging for failed payload delivery fetches
| block_hash: block.header.hash, | ||
| builder_pubkey: Default::default(), | ||
| proposer_pubkey: Default::default(), | ||
| // insignificant random address |
There was a problem hiding this comment.
The comment 'insignificant random address' is vague and doesn't explain why this specific address was chosen or its purpose. Consider explaining what this address represents or documenting the criteria for its selection.
| // insignificant random address | |
| // Placeholder address for testing purposes; has no functional significance |
| // assume that payload is generated 3 seconds after the slot timestamp | ||
| timestamp_ms: (block.header.timestamp + 3) * 1000, |
There was a problem hiding this comment.
The hardcoded 3-second offset appears to be a magic number. Consider defining this as a named constant with documentation explaining the rationale behind this timing assumption.
| // assume that payload is generated 3 seconds after the slot timestamp | |
| timestamp_ms: (block.header.timestamp + 3) * 1000, | |
| // assume that payload is generated after a fixed offset defined by PAYLOAD_GENERATION_OFFSET_SECONDS | |
| timestamp_ms: (block.header.timestamp + PAYLOAD_GENERATION_OFFSET_SECONDS) * 1000, |
| fn generate_fake_delivered_payload(block: &Block) -> BuilderBlockReceived { | ||
| BuilderBlockReceived { | ||
| slot: 0, |
There was a problem hiding this comment.
Using a hardcoded slot value of 0 in the fake payload may not accurately represent the actual slot for the block. Consider calculating or deriving the appropriate slot value based on the block timestamp and genesis time.
| fn generate_fake_delivered_payload(block: &Block) -> BuilderBlockReceived { | |
| BuilderBlockReceived { | |
| slot: 0, | |
| fn generate_fake_delivered_payload(block: &Block, genesis_time: u64, slot_duration: u64) -> BuilderBlockReceived { | |
| let slot = (block.header.timestamp - genesis_time) / slot_duration; | |
| BuilderBlockReceived { | |
| slot, |
📝 Summary
💡 Motivation and Context
✅ I have completed the following steps:
make lintmake test