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

Block building core #401

Merged
merged 11 commits into from
Sep 15, 2023
Merged

Block building core #401

merged 11 commits into from
Sep 15, 2023

Conversation

danielSanchezQ
Copy link
Collaborator

  • Added transactions selections trait
  • Added blob selection trait
  • Implemented basic size filling tx selector
  • Implemented basic size filling blob selector
  • Implemented block builder with composing tx+blob selectors

Comment on lines 2 to 3
use serde::de::DeserializeOwned;
use serde::Serialize;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: not std

use consensus_engine::overlay::RandomBeaconState;
use consensus_engine::{NodeId, Qc, View};

pub struct BlockBuilder<Tx, Blob, TxSelector, BlobSelector> {
Copy link
Contributor

Choose a reason for hiding this comment

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

how would this be used? I think an example might help me understand

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not really sure I understand exactly. But it is just a wrapper over the Block::new that throws into the mix the transaction and blob selectors (Which should be some static heuristic).

Core is the build method:

Block::new(
                view,
                parent_qc,
                tx_selector.select_tx_from(txs),
                blob_selector.select_blob_from(blobs),
                proposer,
                beacon,
            )

The idea is to just use it when the leader propose the block.

I had in mind that we could even have a service that handles the next block building depending on different events in the node:

  • View change
  • New tx arrived
  • New blob arrived
  • ...
    So it always have something ready when needed.

But for now I think this is enough.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

how would this be used? I think an example might help me understand

I added an example to the builder, but I do not think that is what you reffered to, hence my answer above.

Copy link
Contributor

@youngjoon-lee youngjoon-lee left a comment

Choose a reason for hiding this comment

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

👍

nomos-core/src/utils/select.rs Outdated Show resolved Hide resolved
nomos-core/src/da/blob/select.rs Outdated Show resolved Hide resolved
danielSanchezQ and others added 2 commits September 14, 2023 10:25
Co-authored-by: Youngjoon Lee <taxihighway@gmail.com>
Co-authored-by: Youngjoon Lee <taxihighway@gmail.com>
@danielSanchezQ danielSanchezQ merged commit e1e2b84 into master Sep 15, 2023
11 of 13 checks passed
@danielSanchezQ danielSanchezQ mentioned this pull request Sep 18, 2023
@jakubgs jakubgs deleted the block-building branch February 15, 2024 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transaction (tx) selection Select blobs to be included
4 participants