Skip to content

Commit

Permalink
Merge pull request #23 from 0xPolygon/nadim/pos2
Browse files Browse the repository at this point in the history
Nadim/pos2
  • Loading branch information
kmurphypolygon authored Nov 28, 2023
2 parents bf3facd + d425d9f commit a0de7ec
Show file tree
Hide file tree
Showing 72 changed files with 653 additions and 3,388 deletions.
54 changes: 29 additions & 25 deletions docs/_site_essentials/stylesheets/extra.css
Original file line number Diff line number Diff line change
@@ -1,50 +1,54 @@
[data-md-color-scheme="slate"] {
--md-footer-bg-color: black;
.md-footer, .md-footer__inner, .md-footer-meta {
background-color: black;
}
--md-footer-bg-color: black;

.md-footer,
.md-footer__inner,
.md-footer-meta {
background-color: black;
}
}

[data-md-color-scheme="default"] {
--md-footer-bg-color: white;
--md-footer-fg-color: charcoal;
--md-default-bg-color: white;
--md-footer-fg-color--light: charcoal;
--md-footer-fg-color--lighter: charcoal;
.md-footer, .md-footer__inner, .md-footer-meta {
background-color: white;
}
--md-footer-bg-color: white;
--md-footer-fg-color: charcoal;
--md-default-bg-color: white;
--md-footer-fg-color--light: charcoal;
--md-footer-fg-color--lighter: charcoal;

.md-footer,
.md-footer__inner,
.md-footer-meta {
background-color: white;
}
}

img.figure {
border: 5px solid #ae6fdb !important;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
margin: 0 auto;
max-width: 80%;
display: block;
border: 5px solid #ae6fdb !important;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
margin: 0 auto;
max-width: 80%;
display: block;
}

div.flex-figure {
display: flex;

display: flex;
}

div.flex-figure div.flex-figure-left {
flex-grow: 2;
flex-grow: 2;
}

div.flex-figure div.flex-figure-right {
flex-grow: 1;
flex-shrink: 1.5;
flex-grow: 1;
flex-shrink: 1.5;
}


/*
.md-footer, .md-footer__inner, .md-footer-meta {
background-color: black;
background-color: black;
}
*/

.md-footer__inner {
display: none !important;
display: none !important;
}
3 changes: 1 addition & 2 deletions docs/_site_essentials/stylesheets/section-nav.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
div.section-nav {
}
div.section-nav {}

div.section-nav .section-nav-item {
border-radius: 20px;
Expand Down
Binary file modified docs/img/cdk/cdk-block-explorer-empty.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 modified docs/img/cdk/cdk-bridge-completed-l1-to-l2.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 modified docs/img/cdk/cdk-bridge-confirm.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 modified docs/img/cdk/cdk-bridge-connected.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 modified docs/img/cdk/cdk-bridge-l2-to-l1-completed.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 modified docs/img/cdk/cdk-bridge-l2-to-l1-on-hold.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 modified docs/img/cdk/cdk-bridge-l2-to-l1.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 modified docs/img/cdk/cdk-metamask-add-l1.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 modified docs/img/cdk/cdk-metamask-add-network.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 modified docs/img/cdk/cdk-metamask-import-account.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 modified docs/img/cdk/cdk-metamask-switch-network.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 modified docs/img/cdk/cdk-modes.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 modified docs/img/cdk/cdk-tx-view-on-block-explorer.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 modified docs/img/cdk/zksupernets-dac.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 modified docs/img/pos/Screenshot_2020-02-20_at_2.55.10_PM.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 docs/img/pos/alchemy-dashboard.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 modified docs/img/pos/bor-span.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 docs/img/pos/brownie-commands.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 docs/img/pos/brownie-compile.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 docs/img/pos/brownie-run.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 docs/img/pos/calls.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 docs/img/pos/create-app.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 docs/img/pos/faucet.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 docs/img/pos/get-balance.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 docs/img/pos/http_URL.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 docs/img/pos/join-network.png
Binary file modified docs/img/pos/matic_structure.png
Binary file added docs/img/pos/new-account.png
Binary file added docs/img/pos/polygon-scan.png
Binary file added docs/img/pos/polygonscan.png
Binary file added docs/img/pos/sign-up.png
Binary file added docs/img/pos/token-sol.png
Binary file added docs/img/pos/tw-explore.png
Binary file added docs/img/pos/view-key.png
Binary file modified docs/img/zkvm/fig1-simpl-arch.png
Binary file modified docs/img/zkvm/fig2-simple-poe.png
Binary file modified docs/img/zkvm/fig4-zkProv-arch.png
Binary file modified docs/img/zkvm/flatten-code-remix.png
Binary file modified docs/img/zkvm/zkv-confirm-zketh.png
Binary file modified docs/img/zkvm/zkv-end-product-nft-code.png
8 changes: 3 additions & 5 deletions docs/pos/architecture/bor/state-sync.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# State Sync Mechanism

`State Sync` is the native mechanism to read Ethereum data from Matic EVM chain.

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 (read more about the architecture [here](/docs/pos/design/bor/overview).
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.

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.

Expand Down Expand Up @@ -78,13 +76,13 @@ interface IStateReceiver {
Only `0x0000000000000000000000000000000000001001``StateReceiver.sol`, must be allowed to call `onStateReceive` function on target contract.
## System Call
## System call
Only system address, `2^160-2`, allows making a system call. Bor calls it internally with the system address as `msg.sender`. It changes the contract state and updates the state root for a particular block. Inspired from [https://github.com/ethereum/EIPs/blob/master/EIPS/eip-210.md](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-210.md) and [https://wiki.parity.io/Validator-Set#contracts](https://wiki.parity.io/Validator-Set#contracts)
System call is helpful to change state to contract without making any transaction.
## State-sync logs and Bor Block Receipt
## State-sync logs and Bor block receipts
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).
Expand Down
2 changes: 0 additions & 2 deletions docs/pos/architecture/heimdall/modules/checkpoint.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

`checkpoint` module manages checkpoint related functionalities for Heimdall. It needs Bor chain when a new checkpoint is proposed on Heimdall to verify checkpoint root hash.

All related to checkpoint data is explained in details [here](/docs/pos/design/heimdall/checkpoint).

## Checkpoint life-cycle

Heimdall uses the same leader selection algorithm as Tendermint to select the next proposer. While submitting checkpoints on the Ethereum chain, it may fail due to multiple reasons like gas limit, traffic on Ethereum, high gas fees. That's why the multi-stage checkpoint process is required.
Expand Down
51 changes: 0 additions & 51 deletions docs/pos/architecture/heimdall/modules/clerk.md

This file was deleted.

16 changes: 0 additions & 16 deletions docs/pos/architecture/heimdall/modules/staking.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,6 @@

Staking module manages validator related transactions and state for Heimdall. Note that a validator stakes their tokens on the Ethereum chain and becomes a validator. Respective validators send the transactions on Heimdall using necessary parameters to acknowledge the Ethereum stake change. Once the majority of the validators agree on the change on the stake, this module saves the validator information on Heimdall state.

## Key Management

For key management, please refer to [Validator key management](/docs/pos/design/heimdall/validator-key-management)

## Delegation

This module only manages validator staking on Heimdall. The delegation is only available on smart contracts on the Ethereum chain. To optimize the delegation rewards calculation on smart contracts, we are using validator shares (ERC20 per validator).

More details here: [Delegation (Validator shares)](/pos/reference/contracts/delegation)

## Rewards

All rewards are distributed on the Ethereum chain. The validators and delegators claim their rewards or re-stake by simply sending the transaction on `StakeManager.sol`

More details here: [Rewards](/docs/pos/design/validator/rewards.md#what-is-the-incentive)

## Messages

<img src="img/pos/stake-management-flow.svg" />
Expand Down
1 change: 0 additions & 1 deletion docs/pos/concepts/tokens/pol.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ Separately, you are encouraged to engage in the governance and decision-making p
Your involvement and input can play a significant role in shaping the future of the Polygon ecosystem.

You can participate in governance proposals to vote on various aspects of the Polygon ecosystem through the PIP program.
Check out how to do so [<ins>here</ins>](/docs/category/proposals/).

### **Do** I Need to Do Anything Today **as a Node Operator or Delegator?**

Expand Down
19 changes: 2 additions & 17 deletions docs/pos/get-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,25 +137,10 @@ Bor does the following:

Bor is the Block producer node and layer for the Polygon Network. It is based on Go Ethereum. Blocks produced on Bor are validated by Heimdall nodes.

:::info See Also
!!! info "Community resources"

* GitHub repository: [Bor](https://github.com/maticnetwork/bor)
* Blog post: [Heimdall and Bor](https://blog.polygon.technology/heimdall-and-bor/)

:::

This section guides you through the following topics:

* [Validator responsibilities](/pos/design/validator/responsibilities.md)
* Joining the network as a validator:
* [Start and run the nodes with Ansible](/pos/validator/run-validator/ansible.md)
* [Start and run the nodes with binaries](/pos/validator/run-validator/binaries.md)
* [Stake as a validator](/pos/validator/validator-staking-operations.md)
* Maintaining your validator nodes:
* [Change the signer address](/pos/validator/change-signer-address.md)
* [Change the commission](/pos/validator/validator-commission-operations.md)

Community assistance:

* [Discord](https://discord.com/invite/0xPolygon)
* [Forum](https://forum.polygon.technology/)

Loading

0 comments on commit a0de7ec

Please sign in to comment.