-
Notifications
You must be signed in to change notification settings - Fork 44
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
Frrist/receipt events schema #1132
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
- track the value of EventRoots contained in message receipts.
e525fdd
to
be3f295
Compare
* feat: implement actor event task and schema - track the value of EventRoots contained in message receipts.
Nice. |
CREATE TABLE IF NOT EXISTS {{ .SchemaName | default "public"}}.actor_events ( | ||
height bigint NOT NULL, | ||
state_root text NOT NULL, | ||
event_index bigint NOT NULL, | ||
message_cid text NOT NULL, | ||
|
||
emitter text NOT NULL, | ||
flags bytea NOT NULL, | ||
key text NOT NULL, | ||
value bytea NOT NULL, | ||
|
||
PRIMARY KEY ("height", "state_root", "event_index", "message_cid") | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@frrist is this tracking the new event schema which includes the codec? FIP-0049 was updated ~2 weeks ago to add a codec field (value 0x55, RAW) always.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will add the codec value shortly, missed that in my initial implementation. Thanks for the pointer!
evtArr, err := amt.LoadAMT(ctx, t.node.Store(), *rec.EventsRoot, amt.UseTreeBitWidth(types.EventAMTBitwidth)) | ||
if err != nil { | ||
report.ErrorsDetected = fmt.Errorf("loading actor events amt (%s): %w", *rec.EventsRoot, err) | ||
return nil, report, nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is capable of using Lotus APIs, you can now invoke the ChainGetEvents
JSON-RPC operation with the events root CID. It will do the AMT handling on the server side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup this has the full lotus API, in #1137 we call that instead, replacing the amt loading logic in this file with the lotus API method.
report.ErrorsDetected = fmt.Errorf("loading actor events amt (%s): %w", *rec.EventsRoot, err) | ||
return nil, report, nil | ||
} | ||
var evt types.Event |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, if the dependencies are updated, this should already. be using the correct event schema (incl. codec). However, you might want to consider inserting the codec as well into the Lily table, although not a big deal since it's a fixed value 0x55 and we can always backfill once other values become possible.
* feat: implement actor event task and schema - track the value of EventRoots contained in message receipts.
* feat: implement actor event task and schema - track the value of EventRoots contained in message receipts.
* deps: update to lotus 1.20.0-rc2 * chore: update actor gen - clean up types, remove lily actors types, replace with go-state-types * Frrist/receipt events schema (#1132) * feat: implement actor event task and schema - track the value of EventRoots contained in message receipts. * feat: implement message param schema and task - create a table that records raw message parameters * feat: track raw receipt return value * fix schema index's after rebase on master * fix: use builtin lotus method to get events - it handles the case of legacy events * fixup! Frrist/receipt events schema (#1132) * deps: replace deprecated blocks package - use github.com/ipfs/go-libipfs/blocks instead * deps: update to v1.20.0 release * feat: track verifreg actor claim HAMT changes (#1141) * feat: track verified registry actor claim HAMT changes - addresses request made here: https://github.com/protocol/pldw/issues/177#issuecomment-1372920524 * fix: correctly diff new actor version (#1145) * fix: correctly diff new actor version - closes #1144 * chore: remove unused metrics * metric: track GettActorStateChanges duration * feat: update lotus deps to support vm para/ret marshal (#1150) - use lotus deps from filecoin-project/lotus#10372 * fix: resolve the duplication issue of db migration version --------- Co-authored-by: Terry <[email protected]>
Produces the below table (example from hyperspace-net):