Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

New apis integration #43

Merged
merged 16 commits into from
Mar 1, 2024
Merged

New apis integration #43

merged 16 commits into from
Mar 1, 2024

Conversation

move47
Copy link
Contributor

@move47 move47 commented Feb 28, 2024

To accomodate new changes in hs-builder-api.

  • It implements the claim_block_header_input api.
  • moves the builder pub, private key inside the global state. It will help easy signing on api responses.
  • Storing num nodes into the builder state. Populating it based on DA proposal message.
  • Moves the hotshot event handling inside the global state.
  • Provides a handle to vid commitment, and await on it before providing response for cliam_block_header_input. It sort of replaces the earlier vid_desperssal handle.

@move47 move47 marked this pull request as draft February 28, 2024 20:03
@move47 move47 self-assigned this Feb 28, 2024
@nyospe
Copy link
Contributor

nyospe commented Feb 29, 2024

Closes #18

@nyospe nyospe linked an issue Feb 29, 2024 that may be closed by this pull request
@move47 move47 changed the title [Draft PR] New apis integration New apis integration Feb 29, 2024
@move47 move47 requested a review from nyospe February 29, 2024 21:02
Copy link
Contributor

@nyospe nyospe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor nits that I'd like you to fix, but overall, this looks good.

<<TYPES as BuilderType>::SignatureKey as SignatureKey>::PureAssembledSignatureType,
pub sender: TYPES::SignatureKey,
pub metadata: <<TYPES as NodeType>::BlockPayload as BlockPayload>::Metadata,
pub join_handle: Arc<JoinHandle<<VidScheme as VidSchemeTrait>::Commit>>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couldn't this just be Arc<JoinHandle<vid::VidCommitment>>?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

// convert vid_num_nodes to usize
// spawn a task to calculate the VID commitment, and pass the builder handle to the global state
// later global state can await on it before replying to the proposer
let join_handle: JoinHandle<<VidScheme as VidSchemeTrait>::Commit> =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't need to be explicitly typed...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

src/service.rs Outdated Show resolved Hide resolved
src/service.rs Outdated
pub tx_sender: BroadcastSender<MessageType<Types>>,

// sending a DA proposal from the hotshot to the builder states
pub da_sender: BroadcastSender<MessageType<Types>>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have these, other than the tx_sender?

Copy link
Contributor Author

@move47 move47 Feb 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since global state implements hotshot events stream service aka run_standalone_builder_service now. Should we take hotshot events stream service out from global state and keep it as separate function as earlier?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will also help in spawning a task based on this standalone function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we need tx_sender in the Global State to implement submit_txn for txn submit api.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@move47 move47 marked this pull request as ready for review March 1, 2024 18:28
Copy link
Contributor

@nyospe nyospe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think the comments in block_hash_to_block's tuple can be removed, but otherwise, this looks good.

Copy link
Contributor

@nyospe nyospe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@move47 move47 merged commit ac951d6 into main Mar 1, 2024
5 checks passed
@move47 move47 deleted the new_apis_integration branch April 8, 2024 10:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Private Mempool support
2 participants