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

Use BlockSpaceAllocator to construct new blocks during PrepareProposal #774

Merged

Conversation

sug0
Copy link
Collaborator

@sug0 sug0 commented Nov 11, 2022

Based on #791

Plugs the block space allocator implementation into PrepareProposal.

@sug0 sug0 mentioned this pull request Nov 11, 2022
8 tasks
@sug0 sug0 force-pushed the tiago/ethbridge/use-tx-bins branch from cca726c to 3debb4b Compare November 14, 2022 14:37
@sug0 sug0 force-pushed the tiago/ethbridge/use-tx-bins branch from 3debb4b to b70d695 Compare November 16, 2022 10:30
@sug0 sug0 changed the title Use tx bins abstraction to construct new blocks during PrepareProposal Use BlockSpaceAllocator to construct new blocks during PrepareProposal Nov 16, 2022
@sug0 sug0 force-pushed the tiago/ethbridge/use-tx-bins branch 3 times, most recently from cda9e25 to 73bb3f2 Compare November 17, 2022 14:27
@sug0 sug0 force-pushed the tiago/ethbridge/use-tx-bins branch from 25771e1 to f7ee18a Compare November 18, 2022 14:02
@sug0 sug0 marked this pull request as ready for review November 29, 2022 14:43
Copy link
Contributor

@james-chf james-chf left a comment

Choose a reason for hiding this comment

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

lgtm

Comment on lines +28 to +30
build-debug:
ANOMA_DEV=false $(cargo) build --package namada_apps --manifest-path Cargo.toml

Copy link
Contributor

Choose a reason for hiding this comment

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

This is useful though would separate it out from this PR, it should go towards main (maybe build-apps-release and build-apps-debug would make more sense as target names but it's separate from this PR)

Comment on lines 1 to 44
//! Compiler hints, to improve the performance of certain operations.

/// A function that is seldom called.
#[inline]
#[cold]
pub fn cold() {}

/// A likely path to be taken in an if-expression.
///
/// # Example
///
/// ```ignore
/// if likely(frequent_condition()) {
/// // most common path to take
/// } else {
/// // ...
/// }
/// ```
#[inline]
pub fn likely(b: bool) -> bool {
if !b {
cold()
}
b
}

/// An unlikely path to be taken in an if-expression.
///
/// # Example
///
/// ```ignore
/// if unlikely(rare_condition()) {
/// // ...
/// } else {
/// // most common path to take
/// }
/// ```
#[inline]
pub fn unlikely(b: bool) -> bool {
if b {
cold()
}
b
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should go towards main, idk much about this. I'd be slightly hesitant to have optimizations like this at this stage (we should be able to do this sort of thing by profiling anyway - https://doc.rust-lang.org/rustc/profile-guided-optimization.html ?).

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 admit I was having way too much fun when I added this module haha

shared/src/types/index_set.rs Outdated Show resolved Hide resolved
shared/src/ledger/storage_api/queries.rs Outdated Show resolved Hide resolved
apps/src/lib/node/ledger/shell/prepare_proposal.rs Outdated Show resolved Hide resolved
apps/src/lib/node/ledger/shell/prepare_proposal.rs Outdated Show resolved Hide resolved
apps/src/lib/node/ledger/shell/prepare_proposal.rs Outdated Show resolved Hide resolved
apps/src/lib/node/ledger/shell/prepare_proposal.rs Outdated Show resolved Hide resolved
@sug0 sug0 requested review from james-chf and batconjurer December 2, 2022 14:23
@sug0 sug0 marked this pull request as draft December 9, 2022 15:49
@sug0 sug0 marked this pull request as ready for review December 9, 2022 16:35
@sug0 sug0 merged commit 83ff8eb into tiago/ethbridge/optimize-block-proposal Dec 12, 2022
@sug0 sug0 deleted the tiago/ethbridge/use-tx-bins branch December 12, 2022 10:07
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.

3 participants