Patched contracts and multichain tables/APIs
New features
-
Patched contracts: You can now customize blockchain executions by directly modifying an existing contract with the Patch component. Patch complements our existing EVM Lambda component, in which you define the code you want to execute on-chain as well as hooks that determine when that code executes. With a patched contract, whenever execution would have involved the contract that you patched, we swap in your patched contract instead. For many purposes, from emitting a little extra data to performing complex simulations, either component can be used. For both, state is reset at the end of the block (more on that below!) to enable parallelization for lightning-fast backfills. So which should you use?
- Lambdas are more flexible: You can insert execution across many contracts (e.g., that share an ABI), or upon each transaction, or each storage write, or each block, etc. None of these is possible with Patch.
- Patch puts you within the contract: If you're interested in a single contract, and particularly if you'd like to emit transient values from it, Patch is very powerful.
When you choose which contract you want to patch, we automatically flatten all of the source code, similarly to the evm.codes contract viewer. As you make edits, toggle on
Show diff
to see the diff between the patched contract and the original. Test in the IDE and deploy a backfill via connecting to a data source, just like the Lambda. For more on Patch, check out our docs and try one yourself.
- Multichain tables/APIs: Our core tables and API templates are now multichain. You'll see
chain_id
as a column in most tables. For the API templates, it's often an optional parameter--if you want to execute the requests across chains, no worries--just leave the defaultchain_id = 0
and we won't filter on chain.
Coming soon
- Stateful probes (as discussed last changelog)
- alpha -> beta + public launch (as discussed last changelog)