Conversation
0dbe7a7 to
ab3d686
Compare
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.
| var errInvalidArguments = errors.New("invalid arguments") | ||
|
|
||
| func (b *ethAPIBackend) GetBody(ctx context.Context, hash common.Hash, number rpc.BlockNumber) (*types.Body, error) { | ||
| if number < 0 || hash == (common.Hash{}) { |
There was a problem hiding this comment.
Why isn't number < 0 allowed? These are all the named blocks, which need to be resolved.
There was a problem hiding this comment.
Well this is copied from libevm: https://github.com/ava-labs/libevm/blob/187c1288585428f96c97eede30c3d1bbbbced26c/eth/api_backend.go#L153
The GetBody function is only used by filters, and that specifically converts from a uint64 to a rpc.BlockNumber. So I assume geth add this check since it can't happen, but seems like passing a uint64 to the backend would be cleaner.
In short we could handle named blocks, but that code will never be hit
| }) | ||
| } | ||
|
|
||
| func TestGetLogs(t *testing.T) { |
There was a problem hiding this comment.
(note to self) Still requires review.
sae/bloom.go
Outdated
| return s.size, sections | ||
| } | ||
|
|
||
| func (s *bloomIndexer) ServiceFilter(ctx context.Context, session *bloombits.MatcherSession) { |
There was a problem hiding this comment.
The existing tests never hit this.
There was a problem hiding this comment.
The problem isn't with the test - The chain indexer wasn't being started (look at the constructor now)
There was a problem hiding this comment.
I added a check to ensure that the bloom indexer does actually run
462f3be to
e80162d
Compare
## Why this should be merged See ava-labs/strevm#120. To get bloom filters for a block when the header doesn't contain the correct bloom because of SAE's delayed settlement, you need a custom accessor to provide arbitrary bloom. ## How this works Introduces an optional interface which, if satisfied by `filters.Backend` implementations, is used to override the Bloom filter instead of retrieving it from the `types.Header`. ## How this was tested Existing tests unchanged. Integration test demonstrates calling of the override method when present. --------- Co-authored-by: Arran Schlosberg <me@arranschlosberg.com>
Adds the two functions required in the backend to implement
eth_getLogs, and adds some basic tests.