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

docs: add payload builder example #3545

Merged
merged 2 commits into from
Jul 3, 2023
Merged

docs: add payload builder example #3545

merged 2 commits into from
Jul 3, 2023

Conversation

mattsse
Copy link
Collaborator

@mattsse mattsse commented Jul 3, 2023

closes #3401

add more docs and example

@mattsse mattsse requested a review from Rjected as a code owner July 3, 2023 11:26
@mattsse mattsse requested a review from onbjerg July 3, 2023 11:26
@mattsse mattsse added the C-docs An addition or correction to our documentation label Jul 3, 2023
@codecov
Copy link

codecov bot commented Jul 3, 2023

Codecov Report

Merging #3545 (e31fe57) into main (4f32f56) will decrease coverage by 0.09%.
The diff coverage is 88.00%.

Impacted file tree graph

Impacted Files Coverage Δ
crates/payload/builder/src/lib.rs 100.00% <ø> (ø)
crates/rpc/rpc/src/eth/api/fees.rs 48.41% <0.00%> (ø)
crates/rpc/rpc/src/eth/pubsub.rs 7.38% <0.00%> (ø)
crates/storage/libmdbx-rs/src/cursor.rs 90.45% <ø> (ø)
crates/blockchain-tree/src/blockchain_tree.rs 81.84% <50.00%> (ø)
crates/blockchain-tree/src/block_buffer.rs 98.63% <100.00%> (ø)
crates/net/downloaders/src/bodies/bodies.rs 89.47% <100.00%> (ø)
crates/revm/revm-inspectors/src/access_list.rs 53.22% <100.00%> (ø)
crates/revm/src/executor.rs 90.75% <100.00%> (ø)
crates/stages/src/stages/hashing_account.rs 95.91% <100.00%> (ø)
... and 7 more

... and 21 files with indirect coverage changes

Flag Coverage Δ
integration-tests 16.23% <16.00%> (-0.01%) ⬇️
unit-tests 63.91% <84.00%> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
reth binary 23.01% <ø> (ø)
blockchain tree 81.25% <75.00%> (ø)
pipeline 86.98% <100.00%> (ø)
storage (db) 73.62% <100.00%> (-0.21%) ⬇️
trie 95.64% <100.00%> (ø)
txpool 50.08% <ø> (-1.07%) ⬇️
networking 77.93% <100.00%> (+0.06%) ⬆️
rpc 57.90% <0.00%> (+0.02%) ⬆️
consensus 62.58% <ø> (ø)
revm 34.99% <100.00%> (ø)
payload builder 6.83% <ø> (ø)
primitives 88.50% <ø> (ø)

Copy link
Member

@gakonst gakonst left a comment

Choose a reason for hiding this comment

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

gg

Comment on lines 71 to 84
//! fn best_payload(&self) -> Result<Arc<BuiltPayload>, PayloadBuilderError> {
//! // NOTE: some fields are omitted here for brevity
//! let payload = Block {
//! header: Header {
//! parent_hash: self.attributes.parent,
//! timestamp: self.attributes.timestamp,
//! beneficiary: self.attributes.suggested_fee_recipient,
//! ..Default::default()
//! },
//! ..Default::default()
//! };
//! let payload = BuiltPayload::new(self.attributes.id,payload.seal_slow(), U256::ZERO);
//! Ok(Arc::new(payload))
//! }
Copy link
Member

Choose a reason for hiding this comment

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

fmt nit

@gakonst gakonst added this pull request to the merge queue Jul 3, 2023
@mattsse mattsse removed this pull request from the merge queue due to a manual request Jul 3, 2023
@mattsse mattsse enabled auto-merge July 3, 2023 12:19
@mattsse mattsse added this pull request to the merge queue Jul 3, 2023
Merged via the queue into main with commit 4d3ce34 Jul 3, 2023
@mattsse mattsse deleted the matt/add-builder-example branch July 3, 2023 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-docs An addition or correction to our documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Example showing how to create a custom payload builder
2 participants