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

[Feature] Implement StateVerifiedClientStatus Lotus-compatible RPC. #3817

Merged
merged 14 commits into from
Jan 18, 2024

Conversation

ruseinov
Copy link
Contributor

@ruseinov ruseinov commented Dec 12, 2023

Summary of changes

Changes introduced in this pull request:

  • Implement StateVerifiedClientStatus Lotus-compatible RPC.

Reference issue to close (if applicable)

work on #3639

Other information and links

Tested with: cargo run --bin=forest-tool -- api compare --filter StateVerifiedClientStatus --lotus /dns/127.0.0.1/tcp/1234/http snapshot-latest.

I have found a way to verify at least one of the two Lotus codepaths, so that's something.

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.

@sudo-shashank
Copy link
Contributor

@ruseinov ruseinov mentioned this pull request Dec 14, 2023
3 tasks
@ruseinov ruseinov marked this pull request as ready for review January 17, 2024 10:31
@ruseinov ruseinov requested a review from a team as a code owner January 17, 2024 10:31
@ruseinov ruseinov requested review from lemmih and aatifsyed and removed request for a team January 17, 2024 10:31
Cargo.toml Outdated Show resolved Hide resolved
let id = self.lookup_id(addr, ts)?.expect("actor not found");
let network_version = self.get_network_version(ts.epoch());

// This is a copy of Lotus code, we need to treat all the actors below version 9
Copy link
Contributor

Choose a reason for hiding this comment

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

wibni: link to a tagged file + line number - helps if someone needs to update the port

src/state_manager/mod.rs Show resolved Hide resolved
Comment on lines 468 to 469
// Those proven hard to verify as most of the time both lotus and forest return 'null'. So it's
// hardcoded.
Copy link
Contributor

Choose a reason for hiding this comment

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

this doesn't quite make sense to me - consider rewording?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This note implies understanding of snapshot tests, which takes n last tipsets and tries to verify the results for both Lotus and Forest using the addresses found. Since last n tipsets data doesn't return anything but null for both - the addresses are hardcoded.

ruseinov and others added 3 commits January 17, 2024 14:08
Co-authored-by: Aatif Syed <38045910+aatifsyed@users.noreply.github.com>
@elmattic
Copy link
Contributor

Have you tested if this also works with the new --ws flag?

@ruseinov
Copy link
Contributor Author

Have you tested if this also works with the new --ws flag?

I have not, should I? Not sure if it's at all relevant as long as the format is the same. If you didn't have to introduce any changes to other endpoints for said flag - I don't expect this one needing any special treatment. Otherwise let me know what needs to be done.

@elmattic
Copy link
Contributor

Have you tested if this also works with the new --ws flag?

I have not, should I?

No, it was just by curiosity. The test of this flag should be done on the CI anyway.

Not sure if it's at all relevant as long as the format is the same. If you didn't have to introduce any changes to other endpoints for said flag - I don't expect this one needing any special treatment. Otherwise let me know what needs to be done.

FYI, you can test it in your case with: cargo run --bin=forest-tool -- api compare --ws --filter StateVerifiedClientStatus --lotus /dns/127.0.0.1/tcp/1234/ws snapshot-latest.

addr: &Address,
ts: &Arc<Tipset>,
) -> anyhow::Result<Option<DataCap>> {
let id = self.lookup_id(addr, ts)?.expect("actor not found");
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we rather propagate the error? We wouldn't like to crash the node in case in case of a missing actor, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, you are right. We should, I will just convert the None value to an error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@ruseinov ruseinov added this pull request to the merge queue Jan 18, 2024
Merged via the queue into main with commit da64d4b Jan 18, 2024
27 checks passed
@ruseinov ruseinov deleted the ru/feature/state-verified-c-status branch January 18, 2024 19:01
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.

None yet

5 participants