Skip to content

Commit f24c17c

Browse files
authored
Merge pull request 0xPolygon#2688 from 0xPolygon/mardizzone/docs-update
update docs for hv2
2 parents f7f54fc + 85d260d commit f24c17c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+342
-1596
lines changed

docs/cdk/how-to/deploy-t1-prover-devnet.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ The following steps create some test data.
7272
7373
1. Start the devnet up with `docker compose up`. If you had previously run this command, you might want to wipe old data with a `make clean` to avoid running from a previous state.
7474
2. Wait for blocks to start being produced. This should only take a few seconds. You can use `polycli monitor` to quickly check that blocks are being created.
75-
3. Generate some load and test transactions, by using a tool like [polycli](https://github.com/maticnetwork/polygon-cli/blob/main/doc/polycli_loadtest.md) to create transactions.
75+
3. Generate some load and test transactions, by using a tool like [polycli](https://github.com/0xPolygon/polygon-cli/blob/main/doc/polycli_loadtest.md) to create transactions.
7676
4. Once the load is done, and if you ran docker in detached mode, you can stop the devnet with `docker compose stop`.
7777
5. Checkout and build [jerrigon](https://github.com/0xPolygonZero/erigon/tree/feat/zero) from the `feat/zero` branch. You can use `make all` to build everything.
7878
6. Create a copy of the erigon state directory to avoid corrupting things
@@ -155,4 +155,4 @@ We expect that the following transaction types or use-cases to prove without any
155155
polycli wallet inspect --mnemonic "code code code code code code code code code code code quality" | jq '.Addresses[] | {"key": .ETHAddress, "value": { "balance": "0x21e19e0c9bab2400000"}}' | jq -s 'from_entries'
156156
```
157157
158-
[^1]: See Line# 11 of the docker-compose.yml https://github.com/0xPolygonZero/eth-pos-devnet-provable/blob/959da56673c25c2094b1a23bc9e1fa9ae9a9db6e/docker-compose.yml#L11
158+
[^1]: See Line# 11 of the docker-compose.yml https://github.com/0xPolygonZero/eth-pos-devnet-provable/blob/959da56673c25c2094b1a23bc9e1fa9ae9a9db6e/docker-compose.yml#L11

docs/innovation-design/security/reports.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ The scope of the ISO/IEC 27001:2022 certification is limited to the information
2424

2525
## POS
2626

27-
- Bor/Heimdal milestones audit by Least Authority: https://github.com/maticnetwork/bor/blob/develop/audit/audit-feature-milestones.pdf.
2827
- POS portal audits: https://github.com/maticnetwork/pos-portal/tree/master/audits.
2928
- POS contracts: https://github.com/0xPolygon/pos-contracts/tree/main/audit.
3029

docs/pos/architecture/bor/introduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The ratio of stake/staking power specifies the probability to be selected as a m
1111
1. Validators are given slots proportionally according to their stake.
1212
2. Using historical Ethereum block data as seed, we shuffle this array.
1313
3. Now depending on Producer count*(maintained by validator's governance)*, validators are taken from the top.
14-
4. Using this validator set and Tendermint's proposer selection algorithm, we choose a producer for every sprint on Bor.
14+
4. Using this validator set and CometBFT's proposer selection algorithm, we choose a producer for every sprint on Bor.
1515

1616
## Detailed mechanics of Bor consensus
1717

@@ -21,7 +21,7 @@ In Polygon's Proof-of-Stake (PoS) framework, participants can stake MATIC tokens
2121

2222
### Span: Defining validator sets and voting power
2323

24-
A span is a defined set of blocks, during which a specific subset of validators is selected from the broader validator pool. Heimdall provides intricate details of each span through its span-details APIs. Within a span, each validator is assigned a certain voting power. The probability of a validator being chosen as a block producer is directly proportional to their voting power. The selection algorithm for block producers is borrowed from Tendermint's consensus protocol.
24+
A span is a defined set of blocks, during which a specific subset of validators is selected from the broader validator pool. Heimdall provides intricate details of each span through its span-details APIs. Within a span, each validator is assigned a certain voting power. The probability of a validator being chosen as a block producer is directly proportional to their voting power. The selection algorithm for block producers is borrowed from CometBFT's consensus protocol.
2525

2626
### Sprint: Single block producer selection within a span
2727

docs/pos/architecture/bor/state-sync.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
`State sync` is the native mechanism for a user in the Polygon PoS chain to read the latest Ethereum data.
22

3-
Validators on the Heimdall layer pickup the [StateSynced](https://github.com/maticnetwork/contracts/blob/a4c26d59ca6e842af2b8d2265be1da15189e29a4/contracts/root/stateSyncer/StateSender.sol#L24) event and pass it on to the Bor layer.
3+
Validators on the Heimdall layer pickup the [StateSynced](https://github.com/0xPolygon/pos-contracts/blob/a4c26d59ca6e842af2b8d2265be1da15189e29a4/contracts/root/stateSyncer/StateSender.sol#L24) event and pass it on to the Bor layer.
44

5-
The receiver contract inherits [IStateReceiver](https://github.com/maticnetwork/genesis-contracts/blob/master/contracts/IStateReceiver.sol), and custom logic sits inside [onStateReceive](https://github.com/maticnetwork/genesis-contracts/blob/05556cfd91a6879a8190a6828428f50e4912ee1a/contracts/IStateReceiver.sol#L5) function.
5+
The receiver contract inherits [IStateReceiver](https://github.com/0xPolygon/genesis-contracts/blob/master/contracts/IStateReceiver.sol), and custom logic sits inside [onStateReceive](https://github.com/0xPolygon/genesis-contracts/blob/05556cfd91a6879a8190a6828428f50e4912ee1a/contracts/IStateReceiver.sol#L5) function.
66

77
This is the flow required from dapps / users to work with state-sync:
88

9-
1. Call the smart contract function present here: [https://github.com/maticnetwork/contracts/blob/19163ddecf91db17333859ae72dd73c91bee6191/contracts/root/stateSyncer/StateSender.sol#L33](https://github.com/maticnetwork/contracts/blob/19163ddecf91db17333859ae72dd73c91bee6191/contracts/root/stateSyncer/StateSender.sol#L33)
9+
1. Call the smart contract function present here: [https://github.com/0xPolygon/pos-contracts/blob/19163ddecf91db17333859ae72dd73c91bee6191/contracts/root/stateSyncer/StateSender.sol#L33](https://github.com/0xPolygon/pos-contracts/blob/19163ddecf91db17333859ae72dd73c91bee6191/contracts/root/stateSyncer/StateSender.sol#L33)
1010
2. Which emits an event called `StateSynced(uint256 indexed id, address indexed contractAddress, bytes data);`
1111
3. All the validators on the Heimdall chain receive this event and one of them, whoever wishes to get the transaction fees for state sync sends this transaction to Heimdall.
1212
4. Once `state-sync` transaction on Heimdall has been included in a block, it is added to pending state-sync list.
1313
5. After every sprint on `bor`, the Bor node fetches the pending state-sync events from Heimdall via an API call.
14-
6. The receiver contract inherits `IStateReceiver` interface, and custom logic of decoding the data bytes and performing any action sits inside `onStateReceive` function: [https://github.com/maticnetwork/genesis-contracts/blob/master/contracts/IStateReceiver.sol](https://github.com/maticnetwork/genesis-contracts/blob/master/contracts/IStateReceiver.sol)
14+
6. The receiver contract inherits `IStateReceiver` interface, and custom logic of decoding the data bytes and performing any action sits inside `onStateReceive` function: [https://github.com/0xPolygon/genesis-contracts/blob/master/contracts/IStateReceiver.sol](https://github.com/0xPolygon/genesis-contracts/blob/master/contracts/IStateReceiver.sol)
1515

1616
## How does state sync work?
1717

@@ -21,7 +21,7 @@ State transfer from Ethereum to Bor happens through system call. Suppose, a user
2121

2222
## State sender
2323

24-
Source: [https://github.com/maticnetwork/contracts/blob/develop/contracts/root/stateSyncer/StateSender.sol](https://github.com/maticnetwork/contracts/blob/develop/contracts/root/stateSyncer/StateSender.sol)
24+
Source: [https://github.com/0xPolygon/pos-contracts/blob/develop/contracts/root/stateSyncer/StateSender.sol](https://github.com/0xPolygon/pos-contracts/blob/develop/contracts/root/stateSyncer/StateSender.sol)
2525

2626
To sync state, the state sender contract calls the `syncState` method on Ethereum chain.
2727

@@ -57,7 +57,7 @@ event StateSynced (
5757
5858
Once the `StateSynced` event is emitted on the `stateSender` contract on Ethereum, Heimdall listens to those events and adds to the Heimdall state after $2/3+$ validators agree on the.
5959
60-
After every sprint (currently 16 blocks on Bor), Bor fetches a new state-sync record and updates the state using a `system` call. Here is the code for the same: [https://github.com/maticnetwork/bor/blob/6f0f08daecaebbff44cf18bee558fc3796d41832/consensus/bor/genesis_contracts_client.go#L51](https://github.com/maticnetwork/bor/blob/6f0f08daecaebbff44cf18bee558fc3796d41832/consensus/bor/genesis_contracts_client.go#L51)
60+
After every sprint (currently 16 blocks on Bor), Bor fetches a new state-sync record and updates the state using a `system` call. Here is the code for the same: [https://github.com/0xPolygon/bor/blob/6f0f08daecaebbff44cf18bee558fc3796d41832/consensus/bor/genesis_contracts_client.go#L51](https://github.com/0xPolygon/bor/blob/6f0f08daecaebbff44cf18bee558fc3796d41832/consensus/bor/genesis_contracts_client.go#L51)
6161
6262
During `commitState`, Bor executes `onStateReceive`, with `stateId` and `data` as args, on target contract.
6363
@@ -83,7 +83,7 @@ System call is helpful to change state to contract without making any transactio
8383
8484
## State-sync logs and Bor block receipts
8585
86-
Events emitted by system calls are handled in a different way than normal logs. Here is the code: [https://github.com/maticnetwork/bor/pull/90](https://github.com/maticnetwork/bor/pull/90).
86+
Events emitted by system calls are handled in a different way than normal logs. Here is the code: [https://github.com/0xPolygon/bor/pull/90](https://github.com/0xPolygon/bor/pull/90).
8787
8888
Bor produces a new transaction/receipt just for the client which includes all the logs for state-sync. Transaction hash is derived from block number and block hash (last block at that sprint):
8989

docs/pos/architecture/heimdall/authentication.md

Lines changed: 0 additions & 150 deletions
This file was deleted.

docs/pos/architecture/heimdall/balance-transfers.md

Lines changed: 0 additions & 46 deletions
This file was deleted.

docs/pos/architecture/heimdall/chain-management.md

Lines changed: 0 additions & 80 deletions
This file was deleted.

0 commit comments

Comments
 (0)