You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* enable to start l1, l2, batch at specific height
* ignoring error bug fix
* add batch start with l2 height flag to sync with l2
* tree starts specific index when initializing the height
* bug fix starting tree index at 1
* change block height query from tx_search to output
* remove unused code
* bug fix searching output index
* config refactor & make queries use context
* lint
* update readme
* change retry sleep to timer
* add logs
* add msg types to pending tx & logs
* delete l2 sync batch start height
* add status
* bump opinit v0.4.2
* lint & format
* chore status change
* update readme
* change tree initialization function to sync once
* add log when broadcaster is waiting for tx timeout
* lint
* retry log msg change
* update readme node version
Copy file name to clipboardExpand all lines: executor/README.md
+104-27
Original file line number
Diff line number
Diff line change
@@ -14,50 +14,126 @@ To configure the Executor, fill in the values in the `~/.opinit/executor.json` f
14
14
{
15
15
// Version is the version used to build output root.
16
16
"version": 1,
17
-
18
17
// ListenAddress is the address to listen for incoming requests.
19
18
"listen_address": "localhost:3000",
20
-
21
-
"l1_rpc_address": "tcp://localhost:26657",
22
-
"l2_rpc_address": "tcp://localhost:27657",
23
-
"da_rpc_address": "tcp://localhost:27657",
24
-
25
-
"l1_gas_price": "0.15uinit",
26
-
"l2_gas_price": "",
27
-
"da_gas_price": "",
28
-
29
-
"l1_chain_id": "testnet-l1-1",
30
-
"l2_chain_id": "testnet-l2-1",
31
-
"da_chain_id": "testnet-da-1",
32
-
33
-
"l1_bech32_prefix": "init",
34
-
"l2_bech32_prefix": "init",
35
-
"da_bech32_prefix": "init",
36
-
19
+
"l1_node": {
20
+
"chain_id": "testnet-l1-1",
21
+
"bech32_prefix": "init",
22
+
"rpc_address": "tcp://localhost:26657",
23
+
"gas_price": "0.15uinit",
24
+
"gas_adjustment": 1.5,
25
+
"tx_timeout": 60
26
+
},
27
+
"l2_node": {
28
+
"chain_id": "testnet-l2-1",
29
+
"bech32_prefix": "init",
30
+
"rpc_address": "tcp://localhost:27657",
31
+
"gas_price": "",
32
+
"gas_adjustment": 1.5,
33
+
"tx_timeout": 60
34
+
},
35
+
"da_node": {
36
+
"chain_id": "testnet-l1-1",
37
+
"bech32_prefix": "init",
38
+
"rpc_address": "tcp://localhost:26657",
39
+
"gas_price": "0.15uinit",
40
+
"gas_adjustment": 1.5,
41
+
"tx_timeout": 60
42
+
},
37
43
// OutputSubmitter is the key name in the keyring for the output submitter,
38
44
// which is used to relay the output transaction from l2 to l1.
39
45
//
40
46
// If you don't want to use the output submitter feature, you can leave it empty.
41
-
"output_submitter": "output_submitter",
47
+
"output_submitter": "",
42
48
43
49
// BridgeExecutor is the key name in the keyring for the bridge executor,
44
50
// which is used to relay initiate token bridge transaction from l1 to l2.
45
51
//
46
52
// If you don't want to use the bridge executor feature, you can leave it empty.
47
-
"bridge_executor": "bridge_executor",
48
-
53
+
"bridge_executor": "",
49
54
// RelayOracle is the flag to enable the oracle relay feature.
50
55
"relay_oracle": true,
51
-
52
56
// MaxChunks is the maximum number of chunks in a batch.
53
57
"max_chunks": 5000,
54
58
// MaxChunkSize is the maximum size of a chunk in a batch.
55
59
"max_chunk_size": 300000,
56
60
// MaxSubmissionTime is the maximum time to submit a batch.
57
-
"max_submission_time": 3600, // seconds
61
+
"max_submission_time": 3600,
62
+
// L2StartHeight is the height to start the l2 node. If it is 0, it will start from the latest height.
63
+
// If the latest height stored in the db is not 0, this config is ignored.
64
+
// L2 starts from the last submitted output l2 block number + 1 before L2StartHeight.
65
+
// L1 starts from the block number of the output tx + 1
66
+
"l2_start_height": 0,
67
+
// StartBatchHeight is the height to start the batch. If it is 0, it will start from the latest height.
68
+
// If the latest height stored in the db is not 0, this config is ignored.
69
+
"batch_start_height": 0
58
70
}
59
71
```
60
72
73
+
### Start height config examples
74
+
If the latest height stored in the db is not 0, start height config is ignored.
75
+
76
+
```
77
+
Output tx 1
78
+
- L1BlockNumber: 10
79
+
- L2BlockNumber: 100
80
+
81
+
Output tx 2
82
+
- L1BlockNumber: 20
83
+
- L2BlockNumber: 200
84
+
85
+
InitializeTokenDeposit tx 1
86
+
- Height: 5
87
+
- L1Sequence: 1
88
+
89
+
InitializeTokenDeposit tx 2
90
+
- Height: 15
91
+
- L1Sequence: 2
92
+
93
+
FinalizedTokenDeposit tx 1
94
+
- L1Sequence: 1
95
+
96
+
FinalizedTokenDeposit tx 2
97
+
- L1Sequence: 2
98
+
```
99
+
100
+
#### Config 1
101
+
```json
102
+
{
103
+
l2_start_height: 150,
104
+
batch_start_height: 0
105
+
}
106
+
```
107
+
When Child's last l1 Sequence is `2`,
108
+
- L1 starts from the height 10 + 1 = 11
109
+
- L2 starts from the height 100 + 1 = 101
110
+
- Batch starts from the height 1
111
+
112
+
#### Config 2
113
+
```json
114
+
{
115
+
l2_start_height: 150,
116
+
batch_start_height: 150
117
+
}
118
+
```
119
+
When Child's last l1 Sequence is `2`,
120
+
- L1 starts from the height 10 + 1 = 11
121
+
- L2 starts from the height 100 + 1 = 101
122
+
- Batch starts from the height 150
123
+
124
+
#### Config 3
125
+
```json
126
+
{
127
+
l2_start_height: 150,
128
+
batch_start_height: 150
129
+
}
130
+
```
131
+
When Child's last l1 Sequence is `1`,
132
+
- L1 starts from the height 5 + 1 = 6
133
+
- L2 starts from the height 100 + 1 = 101
134
+
- Batch starts from the height 150
135
+
136
+
61
137
## Handler rules for the components of the Executor
62
138
For registered events or tx handlers, work processed in a block is atomically saved as ProcessedMsg. Therfore, if ProcessedMsgs or Txs cannot be processed due to an interrupt or error, it is guaranteed to be read from the DB and processed.
63
139
@@ -149,10 +225,11 @@ If the batch info registered in the chain is changed to change the account or DA
0 commit comments