shutter-network / optimism Goto Github PK
View Code? Open in Web Editor NEWThis project forked from ethereum-optimism/optimism
The Optimism monorepo
Home Page: https://optimism.io
License: MIT License
This project forked from ethereum-optimism/optimism
The Optimism monorepo
Home Page: https://optimism.io
License: MIT License
We need to be able to use our own private key in the devnet script. Currently an account is proivided by the RPC.
If shutter is active
if shutter is not active
We want to integrate shutter with all relevant components in the local devnet of the optimism codebase.
Whenever make devnet-up
is invoked and the SHUTTER_ENABLED=true
env var is set, a full ops-bedrock devnet
including all relevant actors in the shutter network should be started in a docker compose setup.
integrate the following shutter repos as git submodules to build the newest development binaries directive
rolling-shutter
op-geth
for faster development, use replace directives in tandem with git submodules
op-geth
op-binding
Inbox
KeyperSetManager
KeyBroadcastContract
KeyperSet
contract for the first keyper setThe shutter node will be a separate application that serves as a gateway to the shutter P2P network and reading the shutter contract's state for the op-node.
It will expose an HTTP API where the op-node can poll for the decryption-key of a certain L2 block-number.
define the HTTP API's technology (push/pull/longpoll, RPC/REST, WS, etc.):
getDecryptionKey(blocknumber int)
. The endpoint will either return immediately when a key has been received already, or it will block until it receives the key and then return.getDecryptionKey(n+1)
, when n
is the current block-number to be build.n
from eth_blockNumber
and release their key for n+1
. Once the key is received by the shutter node, it will return the key immediately to the blocking http request.define the HTTP API's methods / state-transfer model
P2P Handler / Validator functions
L2 JSON RPC client
eth_blockNumber
new unsafe head event workerinternal promise based event listening for long-polling GET requests
concurrency safe data-structure for received events & data persistence (database)
The operator is able to disable Shutter by requesting a new block with an empty decryption key via the engine API (@jannikluhn please share the exact interface with op-geth).
As a first iteration, the op-node should trigger the shutoff mechanism automatically if it wasn't able to receive the key in a specified amount of time. The exact timeout should be configurable.
The shutter keyper for optimism has to listen for new unsafe head blocks and subscribe to the shutter contract states on L2.
threshold
keyshares are seen on P2P networkWith the current devnet script L2 deposit transactions execute on L1 but are not enforced on L2. Need to investigate.
The shutter contracts are predeployed in the genesis file. However, they are not initialized.
In order to let a devnet run we need to send certain transactions in order to initialize the contracts, so they the keyper set starts running.
In production the dao will need to send those transactions.
Initial testnet release (needs a name to distinguish)
Requirements:
Components:
Nice to have:
Stage 2 (needs a name to distinguish)
Stage 3 (needs a name to distinguish)
The OP node is responsible for requesting the next block via the engine API. Which type of block in a shutter system is to be requested is determined by the state of the shutter system contracts.
From the OP node's perspective there are three different block types to be requested:
The op node has different conditions to be met to request the the next block.
For that it needs to keep some internal state to know in which mode the rollup is running.
In its easiest form it's a flag of what the op node thinks the next block should be. Shutterized or unshutterized.
However, it is possible that the node's state is not equal to the actual state at any point in time, thus the node could accidentally request a different block type. This must result in an error being returned by op-geth.
This actually is the input to the internal op-node's shutter state transition.
stateDiagram
direction LR
s1: Disabled
note left of s1
success by engine API => Block could be produced
error by engine API => expects decryption key
end note
s2: Enabled
note right of s2
success by engine API => Block could be produced in time with decryption key
error by Engine API => expects vanilla block
timeout => did not receive decryption key during configured shutter timeout
end note
s1 --> s2: error / (1)
s2 --> s1: error / (3)
s2 --> s1: timeout / (2)
s1 --> s1: success / (3)
s2 --> s2: success / (1)
The op-node consensus client has to be modified to integrate with the shutter op-geth execution client as well as the external shutter P2P integration (see #9) .
We decided to outsource the key listening process into its own application.
The main reason for it is, to keep the diff to the original op-node small as we need to maintain it. The application must
The decryption key must be forwarded to the op-node app. This can be done either by pushing, polling or long-polling by the op-node.
Thus, the op-node app needs to implement this mechanism.
@ezdac any preferences regarding the inter process comms?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.