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.StateMarketStorageDeal #4079

Merged
merged 4 commits into from
Mar 19, 2024

Conversation

hanabi1224
Copy link
Contributor

@hanabi1224 hanabi1224 commented Mar 19, 2024

Summary of changes

Blocked on ChainSafe/fil-actor-states#267

Changes introduced in this pull request:

  • Implement V0 RPC method Filecoin.StateMarketStorageDeal
  • Api compare tests

Test output (with fil-actor-states on ChainSafe/fil-actor-states#267 branch)

➜  forest git:(hm/rpc-state-market-storage-deal) ✗ cargo run --bin forest-tool -- api compare --filter StateMarket ~/fr/
snapshots/calibnet/forest_snapshot_calibnet_2024-03-19_height_1450304.forest.car.zst
    Finished dev [unoptimized] target(s) in 0.39s
     Running `target/debug/forest-tool api compare --filter StateMarket /home/me/fr/snapshots/calibnet/forest_snapshot_calibnet_2024-03-19_height_1450304.forest.car.zst`
| RPC Method                            | Forest | Lotus |
|---------------------------------------|--------|-------|
| Filecoin.StateMarketStorageDeal (100) | Valid  | Valid |

Reference issue to close (if applicable)

Closes

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 force-pushed the hm/rpc-state-market-storage-deal branch from a0b3b33 to c6e0c78 Compare March 19, 2024 08:52
@hanabi1224 hanabi1224 marked this pull request as ready for review March 19, 2024 09:00
@hanabi1224 hanabi1224 requested a review from a team as a code owner March 19, 2024 09:00
@hanabi1224 hanabi1224 requested review from lemmih and LesnyRumcajs and removed request for a team March 19, 2024 09:00
@LesnyRumcajs
Copy link
Member

# Integration tests / Offline RPC check (pull_request) Failing after 2m
+ forest-tool api compare ./forest_snapshot_calibnet_2024-03-19_height_1450337.forest.car.zst --forest /ip4/127.0.0.1/tcp/8080/http --lotus /ip4/127.0.0.1/tcp/8081/http --n-tipsets 5
Error: unimplemented

no green checkmark, no review!

@hanabi1224
Copy link
Contributor Author

hanabi1224 commented Mar 19, 2024

no green checkmark, no review!

@LesnyRumcajs Yeah, need to incorporate ChainSafe/fil-actor-states#268 to make it green. unimplemented is from here

// `get_proposal_array` does not exist for V13
State::V13(_st) => anyhow::bail!("unimplemented"),

@hanabi1224
Copy link
Contributor Author

no green checkmark, no review!

@LesnyRumcajs all green now!

deals.push(deal_id);
Ok(())
})?;
deals.shuffle(&mut OsRng);
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure about this. Tests need to be deterministic if possible. Otherwise, we may end up with flaky tests that are not reproducible.

If we need shuffling, using a pre-determined seed for the RNG might be a way out. What do you think?

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 practice, the snapshot we use (and the tipset to test against) is rolling as well, it's not likely possible to really fix the test cases

Copy link
Member

Choose a reason for hiding this comment

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

But given the same snapshot (e.g., in a local test), making the seed constant would make the test reproducible, right? Or would it still be completely random from network conditions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But given the same snapshot (e.g., in a local test), making the seed constant would make the test reproducible, right?

@LesnyRumcajs That's true, I can remove the shuffle to make it reproducible for a fixed snapshot.

@hanabi1224 hanabi1224 added this pull request to the merge queue Mar 19, 2024
Merged via the queue into main with commit c44802e Mar 19, 2024
28 checks passed
@hanabi1224 hanabi1224 deleted the hm/rpc-state-market-storage-deal branch March 19, 2024 14:24
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