Skip to content

Commit

Permalink
Fix offchain created from offchain (#5051)
Browse files Browse the repository at this point in the history
* refactor: Refactor SubgraphInstance::new_host

* refactor: Move `Hosts` to a module of `instance`

* refactor: Use `mod.rs` style for context and instance

* refactor: Make `mod instance` private to `context`

* fix(offchain): Separate onchain and offchain hosts

The hosts Vec expected the hosts to be pushed in ascending order
of block number. Creating a file ds B within another file ds A violated
that assumption, because B will have the same creation block as A. This
is by design, so the cleanest way to fix this seemed to be separating
the data structures for onchain and offchain hosts. Offchain data sources
do not need to maintain insertion order, as their processing order
ultimately does not impact determinism because they each have their own
causality region. If in the future we introduce a feature that allows
two different offchain data sources to have the same causality region, we maybe
need to revisit this.

* fix: Fix an optimize `*Host::contains`, rename iter_by_address
  • Loading branch information
leoyvens authored Dec 18, 2023
1 parent 4cf0156 commit 72ba5e4
Show file tree
Hide file tree
Showing 10 changed files with 530 additions and 393 deletions.
346 changes: 0 additions & 346 deletions core/src/subgraph/context/instance.rs

This file was deleted.

Loading

0 comments on commit 72ba5e4

Please sign in to comment.