Skip to content

Commit

Permalink
add arcadia.md
Browse files Browse the repository at this point in the history
  • Loading branch information
manojkgorle committed Dec 22, 2024
1 parent 092bcbc commit 23d883a
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 21 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ audited.
The `SeqVM` is built from the ground up with the shared sequencer built directly into the chain
enabling decentralization from the start. This enable users to easily send messages from rollups like NodeKit chain to the shared sequencer. The contents of `SequencerMSG` is just `ChainId|Data|FromAddress` where the data is the transaction data
from the rollup translated into a byte[].
### Arcadia
Rollups using Arcadia, will be able to produce blocks with sub second block times without losing synchronous atomic composability with other rollups using Arcadia, all thanks to Arcadia's ability to preconf rollup block chunks in 250ms and make the block available for rollups to pull instantly after preconfing.

> Read more about arcadia [here](./arcadia.md).
## Demos
The first step to running these demos is to launch your own `SeqVM` Subnet. You
Expand Down Expand Up @@ -59,7 +63,7 @@ When you are done, the output should look something like this:
database: .seq-cli
address: seq1qrzvk4zlwj9zsacqgtufx7zvapd3quufqpxk5rsdd4633m4wz2fdjlydh3t
chainID: Em2pZtHr7rDCzii43an2bBi1M2mTFyLN33QP1Xfjy7BcWtaH9
assetID (use DSEQ for native seq): 27grFs9vE2YP9kwLM5hQJGLDvqEY9ii71zzdoRHNGC4Appavug
assetID (use SEQ for native seq): 27grFs9vE2YP9kwLM5hQJGLDvqEY9ii71zzdoRHNGC4Appavug
balance: 10000 27grFs9vE2YP9kwLM5hQJGLDvqEY9ii71zzdoRHNGC4Appavug
```

Expand Down
43 changes: 43 additions & 0 deletions arcadia.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Arcadia

Arcadia facilitates the Shared Block Production on The Composable Network for participating Rollups. Block Production on arcadia is divided into 12s(6 SEQ blocks) Epochs with a single block builder building blocks for all the participating rollups in that Epoch. Winning block builder is selected through a Ahead Of Time Auction on Arcadia. Rollup blocks are built as chunks and preconfed by validators. All txs in preconfed chunks will be included in SEQ blocks in later time.

## Rollups:
- Rollups opt for shared block production by arcadia ahead of time from a given epoch and added to list of participating rollups for the shared auction.
- Rollups get synchronous atomic composability for the blocks built during the participating epoch.
- Once opt in for shared block production, rollups continue to exist in the list of participating rollups for future epochs, until they entirely opt out or opt out for a specific epoch.
- Rollups opt in and out entirely through `RegisterRollup` action tx.
- Rollups opt out for an epoch through `EpochExit` action tx.

## Ahead Of Time Auction:
- Auction for rights to build blocks for participating rollups in Epoch K starts one Epoch earlier and ends with the proudction of 4th block of SEQ in Epoch K-1.
- Rollups can Opt In or Out for Epoch K, before the end of Epoch K-2. The list of participating rollups for Epoch K finalises with the end of Epoch K-2 and builders bid for rights to build blocks for all participating rollups, based on the perceived value accural for Epoch K and private order flow deals.
- With 4th block of SEQ in Epoch k-1 produced, winning bid is sent to be included in next SEQ block as `Auction` action tx, to deduct bid amount from the builder.
- All participating entities are notified about the bid winner, once the `Auction` action tx makes through a SEQ block.

## Chunks:
- In arcadia txs get preconfed as chunks, rather than blocks.
- There are two defined chunk types: i. Top Of Block(ToB) ii. Rest Of Block(RoB). A chunk consists a set of txs or tx bundles, depending on it being a ToB or RoB.
- SEQ supports a single rollup tx or cross chain bundle in a single tx as multi-action tx is supported.
- A ToB contains cross rollup bundles only. But necessarily a ToB need not contain txs for all participating rollups, but can contain any subset of the list. A RoB contains txs for a single rollup.
- Chunks get preconfed by validators and made available for rollups to pull.
- A Rollup block can have multiple ToB chunks, but only one RoB chunk.

## Block Builders:
- Block builders participate in auction after confirming their ability to build blocks for participating rollups.
- They build ToB chunks for different subsets of participating rollups and RoB chunks for each rollup, and send them with rollup block numbers and chunk nonce to arcadia continuosly to get them preconfed by SEQ validators.
- Every rollup block, ideally contains many ToBs and one RoB. ToBs are ordered by the chunk nonce included along with the chunk followed by RoB.

ToB chunks containig different subset of rollups
![ToB](./assets/tob.png)

A rollup block built by builder.
![Rollup Blocks](./assets/rollup_block.png)
## SEQ Validators:
- SEQ validators register with arcadia to receive chunks for preconfing.
- SEQ validators check few assertions on chunks, and issue a chunk cert if the assertions are satisfied.
- Valdiators store the signature verified txs in a emap, to prevent duplicate txs and ease signature verification while accepting the block.
- SEQ blocks are produced every 2 seconds, validators fetch `SEQMsg` txs payload from arcadia to get included in the SEQ block and fill the rest of the block with `non SEQMsg` txs.

## E2E Flow:
![E2E flow](./assets/e2e.png)
Binary file added assets/e2e.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/rollup_block.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/tob.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 20 additions & 20 deletions tests/integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func init() {
}

func TestIntegration(t *testing.T) {
ginkgo.RunSpecs(t, "tokenvm integration test suites")
ginkgo.RunSpecs(t, "seqvm integration test suites")
}

func init() {
Expand All @@ -112,15 +112,15 @@ func init() {
}

type instance struct {
chainID ids.ID
nodeID ids.NodeID
vm *vm.VM
toEngine chan common.Message
JSONRPCServer *httptest.Server
TokenJSONRPCServer *httptest.Server
WebSocketServer *httptest.Server
cli *rpc.JSONRPCClient // clients for embedded VMs
tcli *trpc.JSONRPCClient
chainID ids.ID
nodeID ids.NodeID
vm *vm.VM
toEngine chan common.Message
JSONRPCServer *httptest.Server
SEQJSONRPCServer *httptest.Server
WebSocketServer *httptest.Server
cli *rpc.JSONRPCClient // clients for embedded VMs
tcli *trpc.JSONRPCClient
}

var _ = ginkgo.BeforeSuite(func() {
Expand Down Expand Up @@ -229,15 +229,15 @@ var _ = ginkgo.BeforeSuite(func() {
tjsonRPCServer := httptest.NewServer(hd[trpc.JSONRPCEndpoint])
webSocketServer := httptest.NewServer(hd[rpc.WebSocketEndpoint])
instances[i] = instance{
chainID: snowCtx.ChainID,
nodeID: snowCtx.NodeID,
vm: v,
toEngine: toEngine,
JSONRPCServer: jsonRPCServer,
TokenJSONRPCServer: tjsonRPCServer,
WebSocketServer: webSocketServer,
cli: rpc.NewJSONRPCClient(jsonRPCServer.URL),
tcli: trpc.NewJSONRPCClient(tjsonRPCServer.URL, snowCtx.NetworkID, snowCtx.ChainID),
chainID: snowCtx.ChainID,
nodeID: snowCtx.NodeID,
vm: v,
toEngine: toEngine,
JSONRPCServer: jsonRPCServer,
SEQJSONRPCServer: tjsonRPCServer,
WebSocketServer: webSocketServer,
cli: rpc.NewJSONRPCClient(jsonRPCServer.URL),
tcli: trpc.NewJSONRPCClient(tjsonRPCServer.URL, snowCtx.NetworkID, snowCtx.ChainID),
}

// Force sync ready (to mimic bootstrapping from genesis)
Expand Down Expand Up @@ -270,7 +270,7 @@ var _ = ginkgo.AfterSuite(func() {

for _, iv := range instances {
iv.JSONRPCServer.Close()
iv.TokenJSONRPCServer.Close()
iv.SEQJSONRPCServer.Close()
iv.WebSocketServer.Close()
err := iv.vm.Shutdown(context.TODO())
require.NoError(err)
Expand Down

0 comments on commit 23d883a

Please sign in to comment.