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: retrieve ddo claims #12

Merged
merged 89 commits into from
Jan 27, 2025
Merged

Conversation

NikolasHaimerl
Copy link
Contributor

This MR proposes the following changes

  1. Add an rpc service for retrieving data from glif
  2. Add an ilpd schema

Context: We are using the glif api to retrieve data from Filecoin. In Filecoin built in actors are responsible for managing and updating the global state of the filecoin network.
DDO (Direct Data Oboarding) in FIL+ deals bypass the usually used StorageActor and oboard data directly. The actor which registers the oboarded data is the verified registry actor (Source).
For spark to be aware of these deals we need to listen to the events emmitted by this actor and look for deals with certain properties (new deals, updated deals,...).

The glif api allows for the fetching of raw built-in Actorevents. The returned data needs to be processed, extracted and then parsed into the correct actor event type.
In this PR the parsing of the ClaimEvent type is being implemented. A sample data point of how the fetched data (after some preprocessing) might look like is stored in test_data. Here, we test that the data can be successfully parsed by the transformer and a class object of the type ClaimEvent can be retrieved for further use.

This implementation is inspired by an existing prototype for fetching build in actor events.

See issue.

Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

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

Almost there! 💪🏻

backend/bin/deal-observer-backend.js Outdated Show resolved Hide resolved
backend/bin/deal-observer-backend.js Outdated Show resolved Hide resolved
backend/bin/deal-observer-backend.js Outdated Show resolved Hide resolved
backend/bin/deal-observer-backend.js Outdated Show resolved Hide resolved
backend/lib/deal-observer.js Outdated Show resolved Hide resolved
"pg": "^8.13.1",
"slug": "^10.0.0"
"request": "^2.88.2",
Copy link
Member

Choose a reason for hiding this comment

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

@NikolasHaimerl please remove this line (the unused dependency).

"slug": "^10.0.0"
"request": "^2.88.2",
"slug": "^10.0.0",
"undici": "^7.2.1"
Copy link
Member

Choose a reason for hiding this comment

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

@NikolasHaimerl please remove this line (the unused dependency).

backend/test/deal-observer.test.js Show resolved Hide resolved
db/migrations/003.do.change-sector-id-type.sql Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@NikolasHaimerl NikolasHaimerl requested a review from bajtos January 24, 2025 13:27
Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

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

I reviewed the latest version and have a few more comments to address.

Also not all of my previous comments have been addressed, PTAL.

Remember to expand the hidden conversations as shown on this screenshot:

Screenshot 2025-01-27 at 10 57 52

backend/bin/deal-observer-backend.js Outdated Show resolved Hide resolved
backend/bin/deal-observer-backend.js Outdated Show resolved Hide resolved
backend/lib/rpc-service/service.js Show resolved Hide resolved
backend/test/deal-observer.test.js Outdated Show resolved Hide resolved
backend/package.json Outdated Show resolved Hide resolved
@NikolasHaimerl NikolasHaimerl requested a review from bajtos January 27, 2025 10:35
Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

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

Please make sure the loop iterating over multiple epochs is written correctly, see https://github.com/filecoin-station/deal-observer/pull/12/files#r1928634351

Other than that, the pull request looks great now! 👌🏻

No further review is necessary as far as I am concerned, merge at will.

backend/bin/deal-observer-backend.js Outdated Show resolved Hide resolved
@NikolasHaimerl
Copy link
Contributor Author

@bajtos

Please make sure the loop iterating over multiple epochs is written correctly, see https://github.com/filecoin-station/deal-observer/pull/12/files#r1928634351

Other than that, the pull request looks great now! 👌🏻

No further review is necessary as far as I am concerned, merge at will.

I believe I committed your code suggestion. Which is why the comment was resolved. But I see that the loop is incorrect. I"ll fix that.

@NikolasHaimerl NikolasHaimerl merged commit 492ff6a into main Jan 27, 2025
8 checks passed
@NikolasHaimerl NikolasHaimerl deleted the nhaimerl-poc-retrieve-DDO-claims branch January 27, 2025 15:20
Copy link

sentry-io bot commented Jan 28, 2025

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON rpcRequest(service) View Issue
  • ‼️ Error: Expected required property rpcRequest(service) View Issue
  • ‼️ Error: Expected string ?(deal-observer) View Issue
  • ‼️ Error: Expected string ?(deal-observer) View Issue
  • ‼️ error: relation "active_deals" does not exist loadDeals(deal-observer) View Issue

Did you find this useful? React with a 👍 or 👎

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