EspressoSystems / HotShot

http://hotshot.docs.espressosys.com/
101 stars 25 forks source link

[CX-Marketplace] - Add the `BundleAndMetadata` Type #3372

Closed jparr721 closed 3 days ago

jparr721 commented 1 week ago

What is this task and why do we need to work on it?

HotShot needs to be able to accept multiple fees for a block to allow for multiple builders to submit bundles with requisite fees as a result of the Solver’s allocation result. Because of this, we’ll need to extend the flow of the Transactions task to support in-loop web requests depending on which version of the code we’re running.

We also will need to augment the contract to how blocks are formed. The existing builder response that exists today in the code is as follows:

/// Builder Provided Responses
pub struct BuilderResponses<TYPES: NodeType> {
    /// Initial API response
    /// It contains information about the available blocks
    pub blocks_initial_info: AvailableBlockInfo<TYPES>,
    /// Second API response
    /// It contains information about the chosen blocks
    pub block_data: AvailableBlockData<TYPES>,
    /// Third API response
    /// It contains the final block information
    pub block_header: AvailableBlockHeaderInput<TYPES>,
}

We need to edit this code since we’re no longer polling for complete blocks from a single builder but, instead, constructing the blocks ourselves, and collecting bundles. So on top of version gating the above flow, we’ll have to manage two types of input. The new payload is as follows:

struct BundleAndMetadata<TYPES: NodeType> {
  bundle: Vec<<TYPES::BlockPayload as BlockPayload<TYPES>>::Transaction>,
  signature_over_bundle: SignatureKey,

  // This might be a BidTx in the future.
  bid_fee: BuilderFee<TYPES>,
  sequencing_fee: BuilderFee<TYPES>
  ...
}

This type will eventually replace the BuilderResponses type as we will no longer need some of the more complex types that are generated for the type, but it will be in later work.

What work will need to be done to complete this task?

No response

Are there any other details to include?

No response

What are the acceptance criteria to close this issue?

The new type is added, but not yet implemented.

Branch work will be merged to (if not the default branch)

No response