From b143813f87c6a0dca9ac139a9b5d3313ed00844e Mon Sep 17 00:00:00 2001 From: Luis Date: Wed, 19 Jul 2023 17:11:26 -0400 Subject: [PATCH 1/5] add EOS finality calculation section --- native/60_advanced-topics/01_consensus-protocol.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/native/60_advanced-topics/01_consensus-protocol.md b/native/60_advanced-topics/01_consensus-protocol.md index 7608b448..9127d820 100644 --- a/native/60_advanced-topics/01_consensus-protocol.md +++ b/native/60_advanced-topics/01_consensus-protocol.md @@ -208,3 +208,17 @@ Block finality is the final outcome of EOS consensus. It is achieved after a sup #### 5.4.1. Goal of Finality The main point of finality is to give users confidence that transactions that were applied prior and up to the LIB block cannot be modified, rolled back, or dropped. The LIB block can also be useful for active nodes to determine quickly and efficiently which branch to build off from, regardless of which is the longest one. This is because a given branch might be longer without containing the most recent LIB, in which case a shorter branch with the most recent LIB must be selected. + +#### 5.4.2. EOS Finality + +Currently, according to the above EOS consensus rules (see [3.1. Layer 1: Native Consensus (aBFT)](#31-layer-1-native-consensus-abft)), each proposed LIB block requires two schedule rounds of BP validations to become final. Since a supermajority of 2/3+1 BPs are required to reach consensus within the EOS mainnet (which accounts for 15 BPs from a total of 21 BPs), it follows that each proposed LIB block becomes final in at least `3` minutes (`180` seconds), according to the calculations below: + +Variable | Value +-|- +**Tp**: Production time per producer | Tp = 0.5 (s/block) x 12 (blocks/producer) ⇒
Tp = 6 (s/producer) (**\***) +**SP**: Supermajority of producers | SP = int[ 2/3 * P (producers) ] + 1 ⇒ [P=21]
SP = int[ 2/3 * 21 (producers) ] + 1 = 14 + 1 (producers) ⇒
SP = 15 (producers) +**CR**: Confirmation Rounds | CR = 2 (rounds) (**\*\***) +**FT**: Finality time | FT = SP x Tp (per round) x CR (rounds) ⇒ [SP=15, Tp=6, CR=2]
FT = 15 (producers) x 6 (s/producer) (per round) x 2 (rounds) ⇒
**FT = 180 (s) = 3 (mins)** + +(**\***): from section [4.2.2. Production Default Values](#422-production-default-values). +(**\*\***): number of schedule rounds required to validate a proposed LIB block. From 19cc09e44a7b65d6420c83698169777dd4ed1d4d Mon Sep 17 00:00:00 2001 From: Luis Date: Wed, 19 Jul 2023 17:13:12 -0400 Subject: [PATCH 2/5] minor formatting edits to 4.2.2 section --- native/60_advanced-topics/01_consensus-protocol.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/native/60_advanced-topics/01_consensus-protocol.md b/native/60_advanced-topics/01_consensus-protocol.md index 9127d820..dd2d6f1d 100644 --- a/native/60_advanced-topics/01_consensus-protocol.md +++ b/native/60_advanced-topics/01_consensus-protocol.md @@ -110,8 +110,8 @@ With the current defaults: P=21 elected producers, Bp=12 blocks created per prod Variable | Value -|- -**Tp**: Production time per producer | Tp = 0.5 (s/block) x 12 (blocks/producer) ⇒ Tp = 6 (s/producer) -**T**: Total production time | T = 6 (s/producer) x 21 (producers) ⇒ T = 126 (s) +**Tp**: Production time per producer | Tp = 0.5 (s/block) x 12 (blocks/producer) ⇒
Tp = 6 (s/producer) +**T**: Total production time | T = 6 (s/producer) x 21 (producers) ⇒
T = 126 (s) When a block is not produced by a given producer during its assigned time slot, a gap results in the blockchain. From 9fdbaa41db4d5e388e3339cb29a77029a605886f Mon Sep 17 00:00:00 2001 From: Luis Date: Thu, 27 Jul 2023 09:46:21 -0400 Subject: [PATCH 3/5] remove line breaks from markdown tables --- native/60_advanced-topics/01_consensus-protocol.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/native/60_advanced-topics/01_consensus-protocol.md b/native/60_advanced-topics/01_consensus-protocol.md index dd2d6f1d..2cc3c056 100644 --- a/native/60_advanced-topics/01_consensus-protocol.md +++ b/native/60_advanced-topics/01_consensus-protocol.md @@ -110,8 +110,8 @@ With the current defaults: P=21 elected producers, Bp=12 blocks created per prod Variable | Value -|- -**Tp**: Production time per producer | Tp = 0.5 (s/block) x 12 (blocks/producer) ⇒
Tp = 6 (s/producer) -**T**: Total production time | T = 6 (s/producer) x 21 (producers) ⇒
T = 126 (s) +**Tp**: Production time per producer | Tp = 0.5 (s/block) x 12 (blocks/producer) ⇒ Tp = 6 (s/producer) +**T**: Total production time | T = 6 (s/producer) x 21 (producers) ⇒ T = 126 (s) When a block is not produced by a given producer during its assigned time slot, a gap results in the blockchain. @@ -215,10 +215,10 @@ Currently, according to the above EOS consensus rules (see [3.1. Layer 1: Native Variable | Value -|- -**Tp**: Production time per producer | Tp = 0.5 (s/block) x 12 (blocks/producer) ⇒
Tp = 6 (s/producer) (**\***) -**SP**: Supermajority of producers | SP = int[ 2/3 * P (producers) ] + 1 ⇒ [P=21]
SP = int[ 2/3 * 21 (producers) ] + 1 = 14 + 1 (producers) ⇒
SP = 15 (producers) +**Tp**: Production time per producer | Tp = 0.5 (s/block) x 12 (blocks/producer) ⇒ Tp = 6 (s/producer) (**\***) +**SP**: Supermajority of producers | SP = int[ 2/3 * P (producers) ] + 1 ⇒ [P=21] SP = int[ 2/3 * 21 (producers) ] + 1 = 14 + 1 (producers) ⇒ SP = 15 (producers) **CR**: Confirmation Rounds | CR = 2 (rounds) (**\*\***) -**FT**: Finality time | FT = SP x Tp (per round) x CR (rounds) ⇒ [SP=15, Tp=6, CR=2]
FT = 15 (producers) x 6 (s/producer) (per round) x 2 (rounds) ⇒
**FT = 180 (s) = 3 (mins)** +**FT**: Finality time | FT = SP x Tp (per round) x CR (rounds) ⇒ [SP=15, Tp=6, CR=2] FT = 15 (producers) x 6 (s/producer) (per round) x 2 (rounds) ⇒ **FT = 180 (s) = 3 (mins)** (**\***): from section [4.2.2. Production Default Values](#422-production-default-values). (**\*\***): number of schedule rounds required to validate a proposed LIB block. From ba2a6cad325313b8ea4900719585703aad57082d Mon Sep 17 00:00:00 2001 From: nsjames Date: Mon, 31 Jul 2023 11:48:34 +0100 Subject: [PATCH 4/5] ignore mdx imports --- evm/10_quick-start/02_setup-metamask.md | 8 +++- evm/10_quick-start/03_evm-tokens.md | 10 ++-- .../20_migrate-your-smart-contract.md | 16 +++++-- native/06_guides/02_create-an-nft.md | 46 +++++++++---------- 4 files changed, 48 insertions(+), 32 deletions(-) diff --git a/evm/10_quick-start/02_setup-metamask.md b/evm/10_quick-start/02_setup-metamask.md index 5be719d7..f3d5b223 100644 --- a/evm/10_quick-start/02_setup-metamask.md +++ b/evm/10_quick-start/02_setup-metamask.md @@ -2,12 +2,16 @@ title: Setup MetaMask --- -import ConnectMetaMask from '@site/src/components/ConnectMetaMask/ConnectMetaMask'; - Click either of these buttons to instantly add EOS EVM to your MetaMask. + + +import ConnectMetaMask from '@site/src/components/ConnectMetaMask/ConnectMetaMask'; + + + ## Adding manually diff --git a/evm/10_quick-start/03_evm-tokens.md b/evm/10_quick-start/03_evm-tokens.md index 5f96f0e1..e82a7697 100644 --- a/evm/10_quick-start/03_evm-tokens.md +++ b/evm/10_quick-start/03_evm-tokens.md @@ -9,12 +9,16 @@ exchanges only support the native version of those tokens, you must *bridge* you ## Testnet faucet -import FaucetTokens from '@site/src/components/FaucetTokens/FaucetTokens'; - Want some EOS tokens to play with? Click the button below to get some from the testnet faucet. + + +import FaucetTokens from '@site/src/components/FaucetTokens/FaucetTokens'; + + + ## Bridge from EOS to EOS EVM ### Bridge tokens yourself @@ -32,7 +36,7 @@ Open your wallet and send **EOS** tokens to `eosio.evm` with your EVM address as To withdraw EOS tokens from a centralized exchange (CEX) to an EOS EVM address: -1. Visit the withdraw screen of the Exchange's app +1. Visit the withdrawal screen of the Exchange's app 2. Select EOS as Coin 3. Select EOS as Network 4. Enter `eosio.evm` as Wallet Address diff --git a/evm/20_smart-contracts/20_migrate-your-smart-contract.md b/evm/20_smart-contracts/20_migrate-your-smart-contract.md index 75fb839c..ef995ca9 100644 --- a/evm/20_smart-contracts/20_migrate-your-smart-contract.md +++ b/evm/20_smart-contracts/20_migrate-your-smart-contract.md @@ -6,22 +6,30 @@ This guide will teach you to deploy a smart contract to the EOS EVM using hardha ## Set up your MetaMask +Click either of these buttons to instantly add EOS EVM to your MetaMask. -import ConnectMetaMask from '@site/src/components/ConnectMetaMask/ConnectMetaMask'; + -Click either of these buttons to instantly add EOS EVM to your MetaMask. +import ConnectMetaMask from '@site/src/components/ConnectMetaMask/ConnectMetaMask'; + -## Getting EOS tokens -import FaucetTokens from '@site/src/components/FaucetTokens/FaucetTokens'; +## Getting EOS tokens Want some EOS tokens to play with? Click the button below to get some from the testnet faucet. + + + +import FaucetTokens from '@site/src/components/FaucetTokens/FaucetTokens'; + + + If you're on the testnet, you can get some EOS tokens using the [**testnet faucet**](https://faucet.testnet.evm.eosnetwork.com/). If you're on the EOS Mainnet, ]you can transfer your native EOS using a standard EOS transfer: diff --git a/native/06_guides/02_create-an-nft.md b/native/06_guides/02_create-an-nft.md index 60aa5672..79ffc5db 100644 --- a/native/06_guides/02_create-an-nft.md +++ b/native/06_guides/02_create-an-nft.md @@ -133,25 +133,25 @@ each action, expand the section below. The `mint` action is used to create a new NFT. It takes two parameters: -- **to** - The account that will own the NFT -- **token_id** - The ID of the NFT +- `to` - The account that will own the NFT +- `token_id` - The ID of the NFT ### Transfer The `transfer` action is used to transfer an NFT from one account to another. It takes four parameters: -- **from** - The account that currently owns the NFT -- **to** - The account that will own the NFT -- **token_id** - The ID of the NFT -- **memo** - A memo that will be included in the transaction +- `from` - The account that currently owns the NFT +- `to` - The account that will own the NFT +- `token_id` - The ID of the NFT +- `memo` - A memo that will be included in the transaction ### BalanceOf The `balanceof` action is used to get the balance of an account. It takes one parameter: -- **owner** - The account that you want to get the balance of +- `owner` - The account that you want to get the balance of It returns a `uint64_t` which is the balance of the account. @@ -160,7 +160,7 @@ It returns a `uint64_t` which is the balance of the account. The `ownerof` action is used to get the owner of an NFT. It takes one parameter: -- **token_id** - The ID of the NFT +- `token_id` - The ID of the NFT It returns a `name` which is the account that owns the NFT. @@ -169,24 +169,24 @@ It returns a `name` which is the account that owns the NFT. The `approve` action is used to approve an account to transfer an NFT on your behalf. It takes two parameters: -- **to** - The account that will be approved to transfer the NFT -- **token_id** - The ID of the NFT +- `to` - The account that will be approved to transfer the NFT +- `token_id` - The ID of the NFT ### ApproveAll The `approveall` action is used to approve an account to transfer all of your NFTs on your behalf. It takes three parameters: -- **from** - The account that currently owns the NFTs -- **to** - The account that will be approved to transfer the NFTs -- **approved** - A boolean that determines if the account is approved or not +- `from` - The account that currently owns the NFTs +- `to` - The account that will be approved to transfer the NFTs +- `approved` - A boolean that determines if the account is approved or not ### GetApproved The `getapproved` action is used to get the account that is approved to transfer an NFT on your behalf. It takes one parameter: -- **token_id** - The ID of the NFT +- `token_id` - The ID of the NFT It returns a `name` which is the account that is approved to transfer the NFT. @@ -195,8 +195,8 @@ It returns a `name` which is the account that is approved to transfer the NFT. The `approved4all` action is used to get if an account is approved to transfer all of your NFTs on your behalf. It takes two parameters: -- **owner** - The account that currently owns the NFTs -- **approved_account** - The account that you want to check if it is approved to transfer the NFTs +- `owner` - The account that currently owns the NFTs +- `approved_account` - The account that you want to check if it is approved to transfer the NFTs It returns a `bool` which is `true` if the account is approved to transfer the NFTs, and `false` if it is not. @@ -205,7 +205,7 @@ It returns a `bool` which is `true` if the account is approved to transfer the N The `gettokenuri` action is used to get the URI of the NFT's metadata. It takes one parameter: -- **token_id** - The ID of the NFT +- `token_id` - The ID of the NFT It returns a `std::string` which is the URI of the NFT's metadata. @@ -214,7 +214,7 @@ It returns a `std::string` which is the URI of the NFT's metadata. The `setbaseuri` action is used to set the base URI of the NFT's metadata. It takes one parameter: -- **base_uri** - The base URI of the NFT's metadata +- `base_uri` - The base URI of the NFT's metadata @@ -244,11 +244,11 @@ Add the following code to your contract above the actions: ``` We've created singleton tables for the following: -- **_owners** - A mapping from token ID to the owner of the NFT -- **_balances** - A mapping from owner to the amount of NFTs they own -- **_approvals** - A mapping from token ID to an account approved to transfer that NFT -- **_approvealls** - A mapping from owner to an account approved to transfer all their NFTs -- **_base_uris** - A configuration table that stores the base URI of the NFT's metadata +- `_owners` - A mapping from token ID to the owner of the NFT +- `_balances` - A mapping from owner to the amount of NFTs they own +- `_approvals` - A mapping from token ID to an account approved to transfer that NFT +- `_approvealls` - A mapping from owner to an account approved to transfer all their NFTs +- `_base_uris` - A configuration table that stores the base URI of the NFT's metadata > ❔ **Table Naming** > From 0646f92e739d407bff19a2b003accb170efde6e0 Mon Sep 17 00:00:00 2001 From: nsjames Date: Mon, 31 Jul 2023 12:07:44 +0100 Subject: [PATCH 5/5] fixes for translated audit links --- native/999_miscellaneous/20_audits.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/999_miscellaneous/20_audits.md b/native/999_miscellaneous/20_audits.md index 5ffcc355..81f9f141 100644 --- a/native/999_miscellaneous/20_audits.md +++ b/native/999_miscellaneous/20_audits.md @@ -6,4 +6,4 @@ Here you can find a list of the audits that have been completed on various EOS s | Date | Audit | Auditor | |------------|----------------------------------------------------------------------------|---------------------| -| 05-03-2023 | [EOS EVM Fuzzing Audit](./05_03_2023_eos_evm_fuzzing_audit_sentnl.pdf) | [sentnl.io](https://sentnl.io/) | +| 05-03-2023 | [EOS EVM Fuzzing Audit](https://docs.eosnetwork.com/docs/latest/miscellaneous/05_03_2023_eos_evm_fuzzing_audit_sentnl.pdf) | [sentnl.io](https://sentnl.io/) |