Skip to content

Commit 4699725

Browse files
committed
docs/node/run-your-node: Fix state sync documentation
Add new `oasis network trust` command. Also removed the part that suggested taking latest height as a trust, which won't work for the stateful nodes.
1 parent ffd5a0b commit 4699725

File tree

1 file changed

+15
-65
lines changed

1 file changed

+15
-65
lines changed

docs/node/run-your-node/advanced/sync-node-using-state-sync.md

Lines changed: 15 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,15 @@ penalized for their misbehaviour and you may be tricked into following the wrong
9898

9999
:::
100100

101-
We recommend using `trust_period=288h` (12 days). This way the time required
102-
to verify headers, submit possible misbehavior evidence and penalize nodes
103-
is still less than the debonding period, giving nodes strong incentive not to lie.
101+
To obtain recommended trust period run Oasis CLI's [trust command][oasis-network-trust].
102+
With current consensus parameters, setting `trust_period` to any value between `220-290h`
103+
(9-12 days) is optimal.
104+
105+
This way the time required to verify headers, submit possible misbehavior evidence and penalize nodes
106+
is still less than the debonding period, giving remote peers strong incentive not to lie. Moreover,
107+
it enables configuring sufficiently old trust as will explained in the next section.
108+
109+
[oasis-network-trust]: https://github.com/oasisprotocol/cli/blob/master/docs/network.md#trust
104110

105111
### Obtaining Trusted Height and Hash
106112

@@ -126,6 +132,12 @@ fetch and compare data from multiple sources.
126132

127133
:::
128134

135+
#### Oasis CLI
136+
137+
If you have Oasis CLI conected to an existing node that you trust, or if your
138+
trust assumptions are fine with using (default) public grpc endpoints (e.g. testnet)
139+
run CLI's [trust command][oasis-network-trust].
140+
129141
#### Block Explorers
130142

131143
Browse to one of our block explorers (e.g. [Oasis Explorer], [Oasis Scan]) and
@@ -138,37 +150,6 @@ obtain the trusted height and hash there:
138150
[Oasis Explorer]: https://explorer.oasis.io/
139151
[Oasis Scan]: https://www.oasisscan.com
140152

141-
#### A Trusted Node
142-
143-
If you have an existing node that you trust, you can use its status output to
144-
retrieve the current block height and hash by running:
145-
146-
```bash
147-
oasis-node control status -a unix:/node/data/internal.sock
148-
```
149-
150-
This will give you output like the following (non-relevant fields omitted):
151-
152-
```json
153-
{
154-
"software_version": "23.0.5",
155-
"identity": {
156-
...
157-
},
158-
"consensus": {
159-
...
160-
"latest_height": 18466200,
161-
"latest_hash": "9611c81c7e231a281f1de491047a833364f97c38142a80abd65ce41bce123378",
162-
"latest_time": "2023-11-27T08:31:15Z",
163-
"latest_epoch": 30760,
164-
...
165-
},
166-
...
167-
}
168-
```
169-
170-
the values you need are `latest_height` and `latest_hash`.
171-
172153
#### Public Rosetta Gateway
173154

174155
First obtain the network's Genesis document's hash (e.g. from the Networks Parameters Page):
@@ -236,34 +217,3 @@ The values you need are `index` and `hash`:
236217
}
237218
}
238219
```
239-
240-
#### Oasis CLI
241-
242-
Query our public Oasis node's endpoint using the Oasis CLI and obtain the
243-
trusted height and hash there:
244-
245-
```bash
246-
oasis network status
247-
```
248-
249-
This will give you output like the following (non-relevant fields omitted):
250-
251-
```json
252-
{
253-
"software_version": "23.0.5",
254-
"identity": {
255-
...
256-
},
257-
"consensus": {
258-
...
259-
"latest_height": 18466200,
260-
"latest_hash": "9611c81c7e231a281f1de491047a833364f97c38142a80abd65ce41bce123378",
261-
"latest_time": "2023-11-27T08:31:15Z",
262-
"latest_epoch": 30760,
263-
...
264-
},
265-
...
266-
}
267-
```
268-
269-
The values you need are `latest_height` and `latest_hash` .

0 commit comments

Comments
 (0)