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: ethereum filters over indexed events #9646

Merged

Conversation

iand
Copy link
Contributor

@iand iand commented Nov 15, 2022

Incorporates all changes from #9644 and adds the capability to maintain Sqlite index of actor events that can be queried via the Eth api functions

From #9644

This PR connects the Lotus-side implementation of events with the FVM, by integrating these branches:

ref-fvm: https://github.com/filecoin-project/ref-fvm/tree/raulk/events
EVM actor: https://github.com/filecoin-project/builtin-actors/tree/raulk/events
filecoin-ffi: https://github.com/filecoin-project/filecoin-ffi/tree/raulk/events
A few schema changes were necessary.

We now display emitted events in the chain/invoke-evm-actor command.

Related Issues

Proposed Changes

Additional Info

Checklist

Before you mark the PR ready for review, please make sure that:

  • Commits have a clear commit message.
  • PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, test
    • area, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps
  • New features have usage guidelines and / or documentation updates in
  • Tests exist for new functionality or change in behavior
  • CI is green

@iand iand requested a review from a team as a code owner November 15, 2022 14:40
@iand iand force-pushed the feat/nv18-events-historic branch from f8209c9 to 73655ed Compare November 15, 2022 15:34
chain/types/event.go Outdated Show resolved Hide resolved
@iand iand changed the base branch from feat/nv18-events to raulk/events-integrate-fvm November 15, 2022 15:44
@iand iand changed the base branch from raulk/events-integrate-fvm to feat/nv18-events November 15, 2022 15:46
@iand iand force-pushed the feat/nv18-events-historic branch from 02460a9 to 1035711 Compare November 15, 2022 18:02
@iand iand changed the title Add actor event indexing feat: ethereum filters over indexed events Nov 15, 2022
Copy link
Member

@raulk raulk left a comment

Choose a reason for hiding this comment

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

TODO

  • Return logs in transaction RPCs.

Comment on lines +250 to +252
// collect filter results
res, err := client.EthGetFilterChanges(ctx, filterID)
require.NoError(err)
Copy link
Member

Choose a reason for hiding this comment

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

We should assert on the data returned.

Comment on lines 47 to 62
// var (
// earliest = "earliest"
// latest = "latest"
// )
//
// // Install a filter.
// filter, err := client.EthNewFilter(ctx, &api.EthFilterSpec{
// FromBlock: &earliest,
// ToBlock: &latest,
// })
// require.NoError(err)
//
// // No logs yet.
// res, err := client.EthGetFilterLogs(ctx, filter)
// require.NoError(err)
// require.Empty(res.NewLogs)
Copy link
Member

Choose a reason for hiding this comment

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

@iand are you planning to add itests for EthGetLogs and EthSubscribe?

Copy link
Member

@raulk raulk left a comment

Choose a reason for hiding this comment

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

There are lint issues and a test failing, but we can fix those in the events branch.

@raulk raulk merged commit cd180f1 into filecoin-project:feat/nv18-events Nov 16, 2022
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.

2 participants