Conversation
| query: ethereum.FilterQuery{ | ||
| BlockHash: utils.PointerTo(common.HexToHash("0xdeadbeef")), | ||
| }, | ||
| wantErrContains: "unknown block", |
There was a problem hiding this comment.
This error is in the filter API and not exported. Seems like a reasonable check, since I can't actually guarantee anything else without the blocking functionality
0dbe7a7 to
ab3d686
Compare
sae/bloom_indexer.go
Outdated
There was a problem hiding this comment.
This whole file seems like it belongs in libevm, not here. Passing channels across API boundaries is a big code smell, suggesting incorrect abstraction/encapsulation.
There was a problem hiding this comment.
Unfortunately, this is how it's implemented in libevm as well....
There was a problem hiding this comment.
Well I moved it to libevm, so I guess if you don't like the boundaries still comment there. At least now, it's not expose to the API backend
sae/rpc.go
Outdated
|
|
||
| // TODO: if we are state syncing, we need to provide the first block available to the indexer | ||
| // via [core.ChainIndexer.AddCheckpoint]. | ||
| b.bloomIndexer.start(b) |
There was a problem hiding this comment.
Is there no way we can avoid this circular dependency?
There was a problem hiding this comment.
We can, but it seemed unnecessarily complex. You need a quite a couple of the functions, so the only other options I know of are:
- Duplicate a bunch of logic in a second struct
- Embed a second struct inside the api backend and just pass that in
Is there a different option, or is one of these better?
There was a problem hiding this comment.
Specifically, we need these methods:
type ChainIndexerChain interface {
CurrentHeader() *types.Header
SubscribeChainHeadEvent(ch chan<- ChainHeadEvent) event.Subscription
OverrideHeaderBloom(header *types.Header) types.Bloom
}
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Adds the two functions required in the backend to implement
eth_getLogs, and adds some basic tests.DO NOT MERGE before ava-labs/libevm#261 is finalized and merged