Phat Contract Offchain Rollup implementation
- E2E test script
- Simple scheduler
- Lock: the correct implementation; may require a rewrite
- Optimization: Batch read from rollup anchor
- Refactor experimantal code as contracts
- Switch to OpenBrush's
ink-env
with the advanced unit test kits
- Switch to OpenBrush's
- SimpleScheduler
- Design
- Query
poll()
- call all the ready targets
- should check health (trigger exactly one health worker)
- Tx
register(config, address, calldata)
owner-only (direct call, stateless) - Tx
delete(id)
owner-only - log the triggered events
- RollupTransactor
- Account management: generate secret key & reveal public key
- Tx
config(rpc, rollup_handler, anchor)
by owner - Query
poll()
- get
Result<RollupResult, Vec<u8>>
response - submit tx to
RollupResult.target_id
- use the latest nonce
- fire and forget
- get
- enum RollupTarget
- EVM(chain, address)
- Pallet(chain)
- Raw tx submit
- Gas efficiency submit - for gas efficiency, save the recent submitted tx to local storage (with timeout) to avoid redundant submission in a short period
- TestOracle
- Minimum implementation
- Real-time fetch price
- Refactor to strip SDK logic
- Locks
- Experimental lock tree (tx_read, tx_write)
- Correct implementation
- struct RollupTx
- Condition
- Updates
- Actions
- struct RollupResult
- RollupTx
- RollupTarget
- (opt) signature of RollupTx
- RollupReadClient
- Read from EVM
- Wrap as QueuedAnchorClient
- Consider block_hash when reading data
- Cross validation
- (low) Cross-platform Rollup
- Basic codec abstraction (
platform::Platform
) - State reading abstraction
- RollupTx serialization
- Basic codec abstraction (
abi.decode()
doesn't have any error handling currently. When it failed, the transaction will get revereted silently, which is hard to debug. So it's always a good habit to verify the raw input todecode()
beforehand.