Skip to content

Minor: Add documentation to generate_block to warn against misusing parameters #1277

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

Merged
merged 2 commits into from
Oct 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions blockprod/src/rpc.rs
Original file line number Diff line number Diff line change
@@ -68,6 +68,17 @@ impl BlockProductionRpcServer for super::BlockProductionHandle {
)
}

/// Generate a block with the given transactions.
///
/// Parameters:
/// - `input_data`: The input data for block generation, such as staking key.
/// - `transactions`: The transactions prioritized to be included in the block.
/// Notice that it's the responsibility of the caller to ensure that the transactions are valid.
/// If the transactions are not valid, the block will be rejected and will not be included in the blockchain.
/// It's preferable to use `transaction_ids` instead, where the mempool will ensure that the transactions are valid
/// against the current state of the blockchain.
/// - `transaction_ids`: The transaction IDs of the transactions to be included in the block from the mempool.
Copy link
Contributor

Choose a reason for hiding this comment

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

IDs -> Ids

/// - `packing_strategy`: Whether or not to include transactions from the mempool in the block, other than the ones specified in `transaction_ids`.
async fn generate_block(
&self,
input_data: HexEncoded<GenerateBlockInputData>,