EVM Parallel funnel
This funnel processes the same primitives as the block funnel, but over extra companion networks. While there can only be a single instance of the block funnel, which is associated to the instance of the Paima L2 contract, an instance of this funnel gets instantiated for every extra network.
Support for parallel chains allows the game node to update based on events in different networks by actively monitoring them (instead of relying on a bridge). For example, this allows you to have your game settle user transactions to a cheap & faster chain ("main chain") while having NFTs for the game live on a separate layer that has higher liquidity and more dApps to compose with.
Conceptually
This funnel has the following steps:
- Fetch blocks & timestamps from the underlying funnel (the main chain you are syncing).
- Fetch the latest block from the parallel funnel.
- Fetch any dynamic primitive that needs to be registered
- Use
eth_getLogs
to get the primitives configured to this funnel in the block range. - Merge the primitives fetched from the parallel funnel with the block from the underlying funnel.
Here is a visual representation of the flow:
Connecting to networks that produce blocks on-demand
Some networks only produce blocks if there are actually transactions on the network (otherwise, nothing happens) such as Arbitrum. This can be problematic for parallel funnels because it makes it hard to differentiate between a block that hasn't been fetched yet and the case where there simply is no block for that time interval.
The emulated block funnel can help mitigate this as it forces an empty block to be made if there hasn't been any block in a while
Connecting to networks with slow blocks
Many networks such as Ethereum L1 have relatively slow block times. This can be mitigated by relying on a delayed state.