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

fix: add Transform implementation for PreCommitInfoExtractorV8 #1242

Merged
merged 5 commits into from
Jul 17, 2023

Conversation

kasteph
Copy link
Contributor

@kasteph kasteph commented Jul 6, 2023

For earlier parts of the chain, i.e. when miner actors were v8 and below, we get the following error:

{
    "level": "warn",
    "ts": "2023-07-06T00:03:04.875Z",
    "logger": "lily/tasks",
    "caller": "actorstate/task.go:140",
    "msg": "failed to transform with error: ",
    "error": "expected MinerPreCommitInfoV9List type but got: miner.MinerPreCommitInfoList"
}

@kasteph kasteph requested review from Terryhung and birdychang July 6, 2023 00:08
Copy link
Collaborator

@Terryhung Terryhung left a comment

Choose a reason for hiding this comment

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

nice!

@birdychang
Copy link
Contributor

Thanks for the fix!

@kasteph kasteph force-pushed the kasteph/fix-missing-precommit branch from 63d8187 to 051dbd1 Compare July 10, 2023 19:58
Comment on lines +361 to +362
case "ARRAY":
datatype = "bigint[]"
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because of this: https://github.com/filecoin-project/lily/blob/master/storage/sql_test.go#L49 -- it's a convenience function being used in such a test.

Moreover, the mapping of data types between Postgres and Golang is not one-to-one that's why the original code has this condition as well because it tries to equate a Postgres datatype with a fld.SQLType here

@@ -449,19 +449,28 @@ func MakeProcessors(api tasks.DataSource, indexerTasks []string) (*IndexerProces
),
minertask.LockedFundsExtractor{},
)
case tasktype.MinerPreCommitInfoV1_8:
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you! This is much better.

@birdychang birdychang merged commit 244215b into master Jul 17, 2023
@birdychang birdychang deleted the kasteph/fix-missing-precommit branch July 17, 2023 15:25
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