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

feat(rpc): implement Filecoin.EthGetBlockTransactionCountByNumber #4305

Merged
merged 3 commits into from
May 10, 2024

Conversation

hanabi1224
Copy link
Contributor

@hanabi1224 hanabi1224 commented May 10, 2024

Summary of changes

Changes introduced in this pull request:

  • Implement RPC method Filecoin.EthGetBlockTransactionCountByNumber
  • API compare tests
     Running `target/quick/forest-tool api compare /home/me/fr/snapshots/calibnet/forest_snapshot_calibnet_2024-05-09_height_1597054.forest.car.zst --filter EthGetBlockTransactionCountByNumber`
| RPC Method                                        | Forest | Lotus |
|---------------------------------------------------|--------|-------|
| Filecoin.EthGetBlockTransactionCountByNumber (10) | Valid  | Valid |

Reference issue to close (if applicable)

Closes #4307

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

@hanabi1224 hanabi1224 marked this pull request as ready for review May 10, 2024 07:49
@hanabi1224 hanabi1224 requested a review from a team as a code owner May 10, 2024 07:49
@hanabi1224 hanabi1224 requested review from lemmih and aatifsyed and removed request for a team May 10, 2024 07:49
fn count_messages_in_tipset(store: &impl Blockstore, ts: &Tipset) -> anyhow::Result<usize> {
let mut message_cids = CidHashSet::default();
for block in ts.block_headers() {
let (bls_messages, secp_messages) = crate::chain::store::block_messages(store, block)?;
Copy link
Member

Choose a reason for hiding this comment

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

Can messages in a block be duplicated?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In one block I think no, in N blocks yes

@hanabi1224 hanabi1224 added this pull request to the merge queue May 10, 2024
Merged via the queue into main with commit 781a150 May 10, 2024
28 checks passed
@hanabi1224 hanabi1224 deleted the hm/EthGetBlockTransactionCountByNumber branch May 10, 2024 09:57
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.

Filecoin.EthGetBlockTransactionCountByNumber
3 participants