Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CX-Marketplace] - Update Sequencing Fees to Support Multiple Fees Per Block #3371

Closed
Tracked by #3348
jparr721 opened this issue Jun 24, 2024 · 1 comment
Closed
Tracked by #3348

Comments

@jparr721
Copy link
Contributor

jparr721 commented Jun 24, 2024

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

Develop an updated API to handle multiple sequencing fees per block.

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. The existing flow in the Transactions task is as follows:

HotShotEvent::ViewChange() => {
...
	let block = {
	    if self
	        .decided_upgrade_certificate
	        .as_ref()
	        .is_some_and(|cert| cert.upgrading_in(block_view))
	    {
	        None
	    } else {
	        self.wait_for_block().await
	    }
	};
	
	if let Some(BuilderResponses {
	    block_data,
	    blocks_initial_info,
	    block_header,
	}) = block
	{
		// Broadcast the block
		...
	} else {
	    // If we couldn't get a block, send an empty block
	    warn!(
	        "Failed to get a block for view {:?}, proposing empty block",
	        view
	    );
			// Construct a null block
			...
	};
...
}

This will be one of the first blocks of versioned code that we interact with. In this, we’ll adjust the wait logic to instead query the solver service via the Sequencer by leveraging the versioning check (defined below) to execute the proper code path depending on what version of hotshot we’re interacting with.

HotShotEvent::ViewChange() => {
...
	let blocks = if self.version >= Marketplace {
			let results = self.auction_results_client.fetch_auction_result(
				block_view
			).await?;
                        let urls = results.map(|res| res.url()).collect();
			let bundles = self.query_all_builders(urls).await?;
			
			// Build the block
			let bundle = PackedBundle {
                               encoded_transactions: bundles.transactions.as_bytes(),
                                pub metadata: <TYPES::BlockPayload as BlockPayload<TYPES>>::Metadata,
                                view_number: block_view,
                                bid_fees: bundles.bid_fees.concat(),
                                sequencing_fees:  bundles.sequencing_fees.concat(),
                                vid_precompute: vid_precompute(bundles), // This method exists

                       }
	} else {
	    Some(vec1![self.wait_for_block().await])
	};
...
}

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

No response

Are there any other details to include?

Confirm with @QuentinI or @nyospe about the details of computing the block fields from the bundles.

What are the acceptance criteria to close this issue?

Tests are written and pass for the various code paths.

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

No response

@ss-es
Copy link
Contributor

ss-es commented Jul 10, 2024

In types/src/traits/block_contents.rs, BlockHeader::new should be updated to take Vec1<BuilderFee<TYPES>> rather than BuilderFee<TYPES>.

@jparr721 jparr721 closed this as completed Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants