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

Add pending support for eth_getBlockByNumber #1048

Merged
merged 8 commits into from
Jun 23, 2023

Conversation

tgmichel
Copy link
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
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
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
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