Skip to content

Add pending support for eth_getBlockByNumber#1048

Merged
sorpaas merged 8 commits intopolkadot-evm:masterfrom
moonbeam-foundation:tgm-pending-block
Jun 23, 2023
Merged

Add pending support for eth_getBlockByNumber#1048
sorpaas merged 8 commits intopolkadot-evm:masterfrom
moonbeam-foundation:tgm-pending-block

Conversation

@tgmichel
Copy link
Copy Markdown
Contributor

@tgmichel tgmichel commented May 4, 2023

Using BlockNumber::Earliest as part of eth_getBlockByNumber rpc returns None. This pr adds support for it adding a new runtime api that applies the current pool and finalizes pallet-ethereum, returning the overlayed/pending ethereum block and statuses.

@tgmichel tgmichel requested a review from sorpaas as a code owner May 4, 2023 14:08
.validated_pool()
.ready()
.map(|in_pool_tx| in_pool_tx.data().clone())
.collect::<Vec<<B as BlockT>::Extrinsic>>(),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
.collect::<Vec<<B as BlockT>::Extrinsic>>(),
.collect::<Vec<_>>(),

.futures()
.iter()
.map(|(_hash, extrinsic)| extrinsic.clone())
.collect::<Vec<<B as BlockT>::Extrinsic>>(),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
.collect::<Vec<<B as BlockT>::Extrinsic>>(),
.collect::<Vec<_>>(),

@koushiro
Copy link
Copy Markdown
Collaborator

@tgmichel could u resolve the conflicts? I wanna this PR could be included in the polkadot-0.9.42 branch.

# Conflicts:
#	client/rpc/src/eth/block.rs
#	template/runtime/src/lib.rs
@sorpaas sorpaas merged commit 67df5c8 into polkadot-evm:master Jun 23, 2023
koushiro pushed a commit to alt-research/frontier that referenced this pull request Jul 12, 2023
* Add `pending` support for `eth_getBlockByNumber`

* header not needed

* cleanup

* prettier

* update some fields to be optional on pending

* update test

* cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants