diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 8e6e63cf4851b..849b8af040cce 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -18,7 +18,7 @@ The project is undergoing daily changes. Pull Requests will be reviewed and resp ## Related PRs -(If this PR adds or changes functionality, please take some time to update or suggest changes to the docs at https://developers.diem.com, and link to your PR here.) +(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/diem/diem/tree/main/developers.diem.com, and link to your PR here.) ## If targeting a release branch, please fill the below out as well diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml index af252e5d36818..99e75f5e2a93c 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/ci-test.yml @@ -134,7 +134,7 @@ jobs: name: find website changes. uses: diem/actions/matches@faadd16607b77dfa2231a8f366883e01717b3225 with: - pattern: "^documentation|^developers.diem.com" + pattern: '^documentation\|^developers.diem.com\|^.github' - id: test-coverage name: check if we should see if code coverage still works. uses: diem/actions/matches@faadd16607b77dfa2231a8f366883e01717b3225 @@ -955,3 +955,37 @@ jobs: retention-days: 5 path: | /tmp/benches + + developers-site: + name: run-developer-site-build + runs-on: ubuntu-latest + if: ${{ needs.prepare.outputs.test-website-build == 'true' }} + steps: + # Checks-out the Diem website repository under $GITHUB_WORKSPACE, so job can access it + - uses: actions/checkout@v2.3.4 + with: + ref: ${{ github.event.pull_request.head.sha }} + - uses: actions/cache@v2.1.6 + # Installs node and yarn + - name: Use Node.js 12 + uses: actions/setup-node@v2.1.5 + with: + node-version: '14' + # Install git + - name: Install git + run: | + sudo apt --assume-yes update + sudo apt --assume-yes install git + # Install Python 3.8 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: '3.8' + # Test that building the site is successful + - name: Build Site + run: | + cd developers.diem.com + # Only build the straight Docusaurus site now. Do not build rust `-r` + # or python docs `-p` on CI checks until we resolve the best way to + # build them for deployment + ./scripts/build_docs.sh -b diff --git a/.gitignore b/.gitignore index 9b7b5d90d76d5..ede3e03e0a2ed 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ # .gitignore file locally for IDE/Emacs/Vim generated files. **/target **/*.rs.bk -/.idea +.idea/ # Ignore wallet mnemonic files used for deterministic key derivation *.mnemonic diff --git a/developers.diem.com/.gitattributes b/developers.diem.com/.gitattributes new file mode 100644 index 0000000000000..d12d8a0491d22 --- /dev/null +++ b/developers.diem.com/.gitattributes @@ -0,0 +1 @@ +*.md -whitespace diff --git a/developers.diem.com/.gitignore b/developers.diem.com/.gitignore new file mode 100644 index 0000000000000..3fadf7bdaa126 --- /dev/null +++ b/developers.diem.com/.gitignore @@ -0,0 +1,25 @@ +# OSX +*.DS_Store +venv + +# Installation +yarn-error.log +package-lock.json + +# Unit test / coverage reports + +# Docusaurus +build/ +i18n/ +node_modules/ + +# Generated files +.docusaurus/ +.cache-loader +.vercel +.idea/ + +# ignore autogenerated docs +diem +static/docs/rustdocs/ +static/docs/python-client-sdk-docs/ diff --git a/developers.diem.com/CONTRIBUTORS.md b/developers.diem.com/CONTRIBUTORS.md new file mode 100644 index 0000000000000..9347b0b23f386 --- /dev/null +++ b/developers.diem.com/CONTRIBUTORS.md @@ -0,0 +1,19 @@ +Thank you to the people who contributed to and improved this website: +- Archana Jayaswal +- Avery Ching +- Ben Maurer +- Brandon Williams +- Brian Johnson +- David Wolinsky +- Eric Nakagawa +- George Cabrera +- jareknowotka +- Joel Marcey +- Kevin Hurley +- nimishamw +- oriooctopus +- Rain +- Sam Blackshear +- Tim Zakian +- Ville Sundell +- Max Kaplan (CapCap) \ No newline at end of file diff --git a/developers.diem.com/COPYRIGHT.md b/developers.diem.com/COPYRIGHT.md new file mode 100644 index 0000000000000..88bbf71532941 --- /dev/null +++ b/developers.diem.com/COPYRIGHT.md @@ -0,0 +1 @@ +COPYRIGHT.txt diff --git a/developers.diem.com/LICENSE-docs b/developers.diem.com/LICENSE-docs new file mode 100644 index 0000000000000..a6d7fd364bcc1 --- /dev/null +++ b/developers.diem.com/LICENSE-docs @@ -0,0 +1,384 @@ +Attribution 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More_considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution 4.0 International Public License ("Public License"). To the +extent this Public License may be interpreted as a contract, You are +granted the Licensed Rights in consideration of Your acceptance of +these terms and conditions, and the Licensor grants You such rights in +consideration of benefits the Licensor receives from making the +Licensed Material available under these terms and conditions. + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + +b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + +c. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + +d. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + +e. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + +f. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + +g. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + +h. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + +i. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + +j. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + +k. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + +Section 2 -- Scope. + +a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part; and + + b. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + +b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties. + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + +a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + 4. If You Share Adapted Material You produce, the Adapter's + License You apply must not prevent recipients of the Adapted + Material from complying with this Public License. + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + +a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database; + +b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material; and + +c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + +a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + +b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + +c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + +Section 6 -- Term and Termination. + +a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + +b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + +c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + +d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + +Section 7 -- Other Terms and Conditions. + +a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + +b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + +Section 8 -- Interpretation. + +a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + +b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + +c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + +d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + +======================================================================= + +Creative Commons is not a party to its public licenses. +Notwithstanding, Creative Commons may elect to apply one of its public +licenses to material it publishes and in those instances will be +considered the "Licensor." Except for the limited purpose of indicating +that material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the public +licenses. + +Creative Commons may be contacted at creativecommons.org. diff --git a/developers.diem.com/README.md b/developers.diem.com/README.md new file mode 100644 index 0000000000000..e5375cfeb5b8a --- /dev/null +++ b/developers.diem.com/README.md @@ -0,0 +1,53 @@ + + + + +
+The gas price, and hence the transaction fee, should rise-and-fall with contention in the DPN. At launch, we expect gas prices to be at or near zero. But in periods of high contention, you can prioritize transactions using the gas price, which will encourage sending only needed transactions during such times. ++ +## Types of resource usage consumed + +For the VM to execute a transaction, the gas system needs to track the primary resources the DPN and VM use. These fall into three resource "dimensions": + +1. The computational cost of executing the transaction. +2. The network cost of sending the transaction over the DPN. +3. The storage cost of data created and read during the transaction on the Diem Blockchain. + +The first two of these resources (computational and network) are ephemeral. On the other hand, storage is long lived. Once data is allocated, that data persists until it is deleted. In the case of accounts, the data lives indefinitely. + +Each of these resource dimensions can fluctuate independently of the other. However, we also have only one gas price. This means that each resource dimension's gas usage needs to be correct, because the gas price only acts as a multiplier to the total gas usage, and does not specify not usage by dimension. The essential property that we design for is that gas usage of a transaction needs to be as highly correlated as possible with the real-world cost associated with executing a transaction. + +## Using gas to compute transaction fee + +When you send a transaction, the transaction fee (in the specifed gas currency) for execution is the gas price multiplied by the VM's computed resource usage for that transaction. + +At different times in the transaction flow, different aspects of resource usage are charged. The basics of the transaction flow and the gas-related logic are detailed in the following diagram: +![FIGURE 1.0 Gas and Transaction Flow](/img/docs/using-gas.svg) +FIGURE 1.0 Gas and Transaction Flow + + + + +In the diagram, both the prologue and epilogue sections are marked in the same color. This is because these sections of the transaction flow need to be **unmetered**: +* In the prologue, it's not known if the submitting account has sufficient funds to cover its gas liability, or if the user submitting the transaction even has authority over the submitting account. Due to this lack of knowledge, when the prologue is executed, it needs to be unmetered. Deducting gas for transactions that fail the prologue could allow unauthorized deductions from accounts. +* The epilogue is in part responsible for debiting the execution fee from the submitting account and distributing it. Because of this, the epilogue must run even if the transaction execution has run out of gas. Likewise, we don't want it to run out of gas while debiting the submitting account as this would cause additional computation to be performed without any transaction fee being charged. + +This means that the minimum transaction fee, `MIN_TXN_FEE`, needs to be enough to cover the average cost of running the prologue and epilogue. + +After the prologue has run, and we've checked in part that the account can cover its gas liability, the rest of the transaction flow starts with the "gas tank" full at `max_gas_amount`. The `MIN_TXN_FEE` is charged, after which the gas tank is then deducted (or "charged") for each instruction the VM executes. This per-instruction deduction continues until either: +* The transaction execution is complete, after which the cost of storing the transaction data is charged, and the epilogue is run and the execution fee deducted, or +* The "gas tank" becomes empty, in which case an `OutOfGas` error is raised. + +In the former, the fee is collected and the result of the transaction is persisted on the Diem Blockchain. The latter causes the execution of the transaction to stop when the error is raised, following which the total gas liability of the transaction is collected. No other remnants of the execution are committed other than the deduction in this case. + +## Using gas to prioritize a transaction + +When you send a transaction, it is prioritized based on different criteria. One of these is the normalized gas price for the transaction. + +For transactions that are subject to ordering by gas price (i.e., non-governance transactions) these prices are first normalized to Diem Coins. This is done by using the current gas currency to Diem Coin conversion rate that is stored on-chain. Transactions are then ranked (in part) based upon this normalized gas price. + +For example: + +* Bob sends a transaction with `gas_price` 10 and `gas_currency` of “BobCoins”. +* Alice sends a transaction at the same time with `gas_price` 20 and `gas_currency` of “AliceCoins”. + +If the on-chain “BobCoins” to Diem Coins exchange rate is 2.1 and the on-chain “AliceCoins” to Diem Coins exchange rate is 1, +* Bob’s transaction has a normalized gas price of `10 * 2.1 = 21`. +* Alice’s transaction has a normalized gas price of `20 * 1 = 20`. + +Then, Bob’s transaction would be ranked higher than Alice’s. + +## Core design principles +Three central principles have motivated the design of gas in Move: + +| Design Principle | Description | +| ---------- | ---------- | +| Move is Turing complete | Because of this, determining if a given Move program terminates cannot be decided statically. However, by ensuring that
+The DiemBFT consensus protocol provides fault tolerance of up to one-third of malicious validator nodes. ++ +## Validator node components + +Each Diem node comprises several logical components: +* [JSON-RPC service](../reference/glossary#json-rpc-service) (disabled in validator nodes) +* [Mempool](#mempool) +* [Consensus (disabled in FullNodes)](#consensus) +* [Execution](#execution) +* [Virtual Machine](#virtual-machine) +* [Storage](#storage) +* [State synchronizer](#state-synchronizer) + + +![validator.svg](/img/docs/validator.svg) +### Mempool + +Mempool is a validator node component that holds an in-memory buffer of transactions that have been submitted but not yet agreed upon and executed. This buffer is replicated between validator nodes. + +The JSON-RPC service of a FullNode sends transactions to a validator node's mempool. Mempool performs initial checks on the requests to protect the other parts of the validator node from corrupt or high volume input. When a new transaction passes the initial checks and is added to the mempool, it is then shared to the mempools of other validator nodes in the Diem Payment Network. + +When a validator node is the leader, its consensus component pulls the transactions from its mempool and proposes the order of the transactions that form a block. The validator quorum then votes on the proposal. + +### Consensus + +Consensus is the validator node component that is responsible for ordering blocks of transactions and agreeing on the results of execution by participating in the consensus protocol with other validator nodes in the network. + +### Execution + +Execution is a validator node component that coordinates the execution of a block of transactions and maintains a transient state. The consensus component votes on this transient state. The execution component maintains an in-memory representation of the execution results until the consensus component commits the block to the distributed database. + +The execution component uses the virtual machine to execute transactions. + +### Virtual machine + +The virtual machine component is used to run the Move program included in a submitted transaction and determine the results. + +A validator node's mempool uses the virtual machine component to perform validation checks on transactions, while its execution component uses it to execute transactions. + + +### Storage + +The storage component is used to persist agreed upon blocks of transactions and their execution results. + + +### State synchronizer + +Validator nodes use their state synchronizer component to “catch up” to the latest state of the blockchain. diff --git a/developers.diem.com/docs/changelog-posts/diem-core-v120.md b/developers.diem.com/docs/changelog-posts/diem-core-v120.md new file mode 100755 index 0000000000000..938b4b3a943ee --- /dev/null +++ b/developers.diem.com/docs/changelog-posts/diem-core-v120.md @@ -0,0 +1,136 @@ +--- +title: "Release v1.2 Announcement" +slug: "diem-core-v120" + +hidden: false +--- +We're announcing the new release v1.2.0 + +Hi all, + +We're announcing the new release v1.2.0. +Release `diem-core-v1.2.0` will be deployed to Diem Testnet on **04/28/2021**, and the `diem-framework-v1.2.0` will be enabled on **04/29/2021**. + +Feel free to post your questions in this [discussion thread](https://developers.diem.com/main/discuss/60875bd734f240002a026c92). + +[diem-core-v1.2.0](https://github.com/diem/diem/tree/diem-core-v1.2.0) + +[Full changelog since diem-core-v1.1.0](https://github.com/diem/diem/compare/diem-core-v1.1.0...diem-core-v1.2.0) + +## Noticeable changes + +**Fixed bugs:** + +- \[Bug\] Broken image in storage README [\#6934](https://github.com/diem/diem/issues/6934) +- \[Bug\] json-rpc method call get\_account\_state\_with\_proof returns server internal error when given an old version [\#6872](https://github.com/diem/diem/issues/6872) +- \[Bug\] Documentation for rotate keys is wrongly using Public Key where it should be Authentication Key [\#7702](https://github.com/diem/diem/issues/7702) +- \[mempool\] Perf regression with CT burst mode [\#7577](https://github.com/diem/diem/issues/7577) +- \[Bug\] account can't send any txn if its balance is less than 600 [\#7238](https://github.com/diem/diem/issues/7238) +- \[Bug\] The url is missing in the sample code curl [\#6887](https://github.com/diem/diem/issues/6887) +- \[Bug\] "Unable to get currency info for Coin1 when converting to on-chain" [\#7368](https://github.com/diem/diem/issues/7368) + + +**Notable changes:** + +**[Build]** + +- [rust] upgrade to rust 1.51 [\#8017](https://github.com/diem/diem/pull/8017) + +**[Consensus]** + +- [consensus] Add reputation window proposals/vote metrics [\#7758](https://github.com/diem/diem/pull/7758) +- [consensus] avoid mempool long poll if root block has user txns [\#7182](https://github.com/diem/diem/pull/7182) + +**[Diem Framework]** + +- [diem framework] Limit the number of validators in the network to 256 or less [\#6952](https://github.com/diem/diem/pull/6952) +- [language] follow up to latest prologue/epilogue changes [\#7063](https://github.com/diem/diem/pull/7063) +- [diem-types] Update currency code restrictions now that we have the real codes. [\#7252](https://github.com/diem/diem/pull/7252) +- [diem framework] make script allowlist immutable [\#7556](https://github.com/diem/diem/pull/7556) +- [diem framework] Add support for concurrent preburns to the DF [\#7648](https://github.com/diem/diem/pull/7648) +- [diem framework] delete tiered minting logic [\#7920](https://github.com/diem/diem/pull/7920) +- [diem framework] Increase max number of child accounts to 2^16 form 2^8 [\#6955](https://github.com/diem/diem/pull/6955) +- [diem framework] introduce diem-framework-releases [\#8028](https://github.com/diem/diem/pull/8028) +- [diem framework] Add gas constant setters [\#8080](https://github.com/diem/diem/pull/8080) + +**[JSON RPC]** + +- [json-rpc] Update failing integration test by increasing timeout. [\#6942](https://github.com/diem/diem/pull/6942) +- [json-rpc] Add `preburn_queues` field to DesignatedDealer view [\#7852](https://github.com/diem/diem/pull/7852) +- [json-rpc] Adding a get_events_with_proof API [\#6539](https://github.com/diem/diem/pull/6539) +- [json-rpc] allow no params field in JSON-RPC API call request [\#7275](https://github.com/diem/diem/pull/7275) +- [json-rpc] fixing race in test with batch call [\#7001](https://github.com/diem/diem/pull/7001) +- [json-rpc] health-check for checking latest ledger info timestamp [\#7419](https://github.com/diem/diem/pull/7419) +- [json-rpc] Support TLS on JSON-RPC port [\#7297](https://github.com/diem/diem/pull/7297) +- [secure] Include Move abort code explanation in the VMStatusView [\#7123](https://github.com/diem/diem/pull/7123) + +**[Logging]** + +- crash-handler: wait till logs have been flushed to exit [\#7378](https://github.com/diem/diem/pull/7378) +- [diem-trace] restore previous behavior of set_diem_trace [\#7667](https://github.com/diem/diem/pull/7667) +- [logging] Add documentation to all structs and macros [\#7707](https://github.com/diem/diem/pull/7707) + +**[Mempool]** + +- [mempool] Add ConnectionMetadata to PeerSyncState [\#7637](https://github.com/diem/diem/pull/7637) +- [mempool] Add in configurable upstream failovers [\#7858](https://github.com/diem/diem/pull/7858) +- [mempool] Add SharedMempool GCing for non-validator peers [\#7687](https://github.com/diem/diem/pull/7687) +- [mempool] Give ordering to upstream peers [\#7809](https://github.com/diem/diem/pull/7809) +- [mempool] Remove legacy failover logic [\#7690](https://github.com/diem/diem/pull/7690) +- [mempool] return accepted for submitting same transaction in mempool [\#7174](https://github.com/diem/diem/pull/7174) +- [mempool] Split up test bootstrap network [\#7765](https://github.com/diem/diem/pull/7765) +- [mempool] Use proper NodeConfig defaults for node types [\#7689](https://github.com/diem/diem/pull/7689) + +**[Move]** + +- Updated to version 1.2 of Move: see the [Move release notes](https://github.com/diem/diem/blob/main/language/RELEASES.md#move-version-12) for details +- With Diem Framework version 2, transaction scripts take an owned `signer` instead of a `&signer` reference. When the on-chain Diem Framework version is set to 1, the VM still expects a `signer` reference [\#8029](https://github.com/diem/diem/pull/8029) + +**[Network]** + +- [network] Prioritize Peer connections and remove 2nd Public network interface [\#7927](https://github.com/diem/diem/pull/7927) +- [network] Allow Conn Manager to be used with Public interfaces [\#7925](https://github.com/diem/diem/pull/7925) +- [network] Decrease network allowed rate limits [\#7177](https://github.com/diem/diem/pull/7177) +- [network] Metric if network identity doesn't match onchain [\#7217](https://github.com/diem/diem/pull/7217) +- [rate-limiter] Allow for disabling throttle in config [\#7176](https://github.com/diem/diem/pull/7176) +- [config] Make rate limiter optional for Validators [\#6941](https://github.com/diem/diem/pull/6941) +- [diem-node] Remove shutdown method after fixing network panic [\#7231](https://github.com/diem/diem/pull/7231) + +**[SDK]** + +- sdk: introduce a new diem-client intended to be apart of the rust-sdk [\#7420](https://github.com/diem/diem/pull/7420) +- add CoinTradeMetadata [\#7582](https://github.com/diem/diem/pull/7582) +- Add constructor and getters for GeneralMetadataV0 as inner fields are private [\#7039](https://github.com/diem/diem/pull/7039) +- add RefundMetadata struct for generating types [\#7502](https://github.com/diem/diem/pull/7502) + +**[State Sync]** + +- [State Sync] Fix potential storage race condition with consensus. [\#7365](https://github.com/diem/diem/pull/7365) +- [State Sync] Make inter-component communication timeouts configurable. [\#7657](https://github.com/diem/diem/pull/7657) +- [State Sync] Remove unneccessary panics to avoid DOS attacks. [\#7778](https://github.com/diem/diem/pull/7778) +- [State Sync] Small cleanups, renames and refactors. [\#7017](https://github.com/diem/diem/pull/7017) +- [State Sync] Update state sync to prioritize preferred peers. [\#7902](https://github.com/diem/diem/pull/7902) +- [State Sync] Perform basic chunk request verification before processing. [\#7520](https://github.com/diem/diem/pull/7520) +- [State Sync] Use checked arithmetic operations to avoid over/under-flows [\#7065](https://github.com/diem/diem/pull/7065) +- [State Sync] Use optimistic fetch for both waypoint and verifiable chunk processing. [\#7595](https://github.com/diem/diem/pull/7595) +- [state-sync] removing integer overflow [\#7060](https://github.com/diem/diem/pull/7060) + +**[Storage]** + +- [backup] metadata cache defaults to temp dir [\#7940](https://github.com/diem/diem/pull/7940) +- [backup] support for specifying trusted waypoints in restore / verify [\#7329](https://github.com/diem/diem/pull/7329) +- [diemdb_bench] initial_commit [\#7407](https://github.com/diem/diem/pull/7407) +- [storage] expose RbReader::get_last_version_before_timestamp() [\#7740](https://github.com/diem/diem/pull/7740) +- [storage] smaller prune_window [\#7197](https://github.com/diem/diem/pull/7197) +- [Proof] Make SparseMerkleProof generic [\#7363](https://github.com/diem/diem/pull/7363) + +**[TCB]** + +- [safety-rules] cleaning [\#7680](https://github.com/diem/diem/pull/7680) +- [safety-rules] removing redundant safety data update [\#7684](https://github.com/diem/diem/pull/7684) +- [Secure Storage] Reduce default timeouts for vault and support custom op tooling timeouts. [\#7743](https://github.com/diem/diem/pull/7743) +- [Secure Storage] Update vault request timeout and error handling. [\#7193](https://github.com/diem/diem/pull/7193) +- [Secure Storage] Vault timeout workaround due to ureq bug. [\#7828](https://github.com/diem/diem/pull/7828) +- [secure-storage] support github branches [\#7150](https://github.com/diem/diem/pull/7150) +- [tcb][safety_rules] added state machine specification [\#7842](https://github.com/diem/diem/pull/7842) +- [Vault Storage] Make the vault client support configurable timeout values [\#7675](https://github.com/diem/diem/pull/7675) \ No newline at end of file diff --git a/developers.diem.com/docs/governance.mdx b/developers.diem.com/docs/governance.mdx new file mode 100644 index 0000000000000..9a17a52e1fe30 --- /dev/null +++ b/developers.diem.com/docs/governance.mdx @@ -0,0 +1,87 @@ +--- +id: governance +title: Governance +--- + +The Diem Association is responsible for the governance of the Diem network and the development of the Diem project. The Association Council functions as a general assembly of Association members, with each represented by an individual representative. + + +## Diem Improvement Proposals (DIP) + +Diem Improvement Proposals (DIPs) offer the Diem developer community a way to participate in advancing the features and functioning of the Diem payment network (DPN), either by proposing a change or engaging in discussion about a proposal. Learn more about how DIPs work [here](https://dip.diem.com/overview). You can also view the current list of [all DIPs]((https://dip.diem.com/all-dips)). + +## Technical Steering Committee + +The [Technical Steering Committee (TSC)](https://www.diem.com/en-us/about-us/#technical_steering_committee) comprises members who supervise technical design and development of the Diem Blockchain. + +Appointed by the Council, the TSC is comprised of representatives from Member organizations who are tasked with advising on the technical design and development of the Diem network. + +#### Martin Apesteguia +Head of Crypto and Services at Xapo. With over 25 years of experience in Fintech companies in technical and operational roles, Martin helped Xapo build its reliable infrastructure and organize its banking operations. As a Diem Association Member, Xapo actively commits its resources to share its experience on various matters (finance, regulatory, etc.) and supporting the Validator’s Network. + +#### George Cabrera III +Diem Core Product Lead of Novi +As Novi’s most senior Technical Product Manager and the product lead for the Diem testnet, George brings a broad and deep understanding of the Diem Blockchain to his role in governance. + +#### Prasanna Gautam +Member of Technical Staff at Anchorage +With deep knowledge in distributed systems, Prasanna Gautam’s stewardship helps ensure that the Diem Blockchain’s open-source community thrives with modern security engineering principles. + +#### David Gill +Senior Director of Technology Innovation at Heifer International +David is focused on how rural cooperatives are being left behind in the digital economy. He is working to overcome challenges in blockchain projects that make it difficult for smallholder farmer cooperatives to participate in global commodity markets. + +#### Joe Lallouz +CEO and Founder of Bison Trails, representing Coinbase +One of the world’s experts on blockchain scalability, security, and decentralization, Joe is committed to democratizing access to blockchain networks. + +#### John S Lee +Innovation Engineer of Shopify +John’s experience in leading blockchain development efforts as well as standard development projects helps steer the consensus-building within the Diem technology stack. + +## Maintainers + +#### Dahlia Malkhi, Diem Association & Diem Networks US ‒ Lead Maintainer +Dahlia Malkhi is the Chief Technology Officer at the Diem Association and Diem Networks US, an applied and foundational researcher in distributed systems technology, author, and international speaker. She co-invented HotStuff, which the Diem Blockchain core (DiemBFT) is based on. + +Previously, she co-founded VMWare Blockchain, co-invented Flexible Paxos, the technology behind Log Device, and created CorfuDB, a database-less database driving VMware’s NSX-T distributed control plane. She has also worked as the technical lead of VMWare Blockchain and CorfuDB. Dahlia is a former associate professor of the Hebrew University of Jerusalem, from where she holds a Ph.D. in computer science. + +#### Sam Blackshear, Move and MoveVM – Maintainer +Sam Blackshear is a research scientist at Novi. He is a co-creator of Move and works on the Move standard library and virtual machine. + +Previously, he worked on the Infer static analyzer and earned a Ph.D. from the University of Colorado, Boulder. + +#### Avery Ching, Consensus and Networking – Maintainer +Avery Ching currently leads the consensus, networking, and performance efforts in Diem. He co-created the DiemBFT consensus protocol that ensures safety and liveness in the Diem Blockchain. + +Previously, he was the technical lead across multiple “big compute” teams at Facebook, including Spark, graph processing, Hive/Hadoop, and batch scheduling. He co-created Apache Giraph. Avery has a Ph.D. in high-performance computing from Northwestern University. + +#### Kevin Hurley, Admission Control and Mempool – Maintainer +Kevin Hurley is the Novi technical lead across several core Diem areas such as client service, mempool, off-chain APIs, and node synchronization. + +Previously, he was the software architect and technical lead of Facebook Payments. Kevin has a Bsc in electrical engineering from Bradley University. + +#### Daniel Prinz, First Group – Maintainer, Payments +Daniel Prinz is the CTO of First Digital Assets Group. He leads teams building a payment platform for merchants to accept Diem Coins, and blockchain tools and APIs for developers using the Diem Blockchain. + +Previously, Daniel was the CTO of the Cyber Division in the Israeli Secret Service, and a Software Architect at SAP and Applied Materials. He has a BSc from Bar-Ilan University in computer science. + +#### David Wolinsky, TCB, Configuration, Crypto – Maintainer +David Wolinsky currently leads the security-infrastructure effort and co-leads networking efforts. He co-created the security architecture that ensures safety in the Diem Blockchain. + +He recently led a DARPA-funded project on provable, scalable anonymous communication at Yale. David has a Ph.D. in building reliable, decentralized peer-to-peer networks from the University of Florida. + +#### Andrew Baine – Manager, Protocols Team, Bison Trails – Production Maintainer +Andrew Baine is a Manager at Bison Trails on the Protocols team. He leads the team responsible for launching, operating, and upgrading nodes on Tendermint, HotStuff, Algorand, Bitcoin, and related networks. He is the lead developer and architect for Bison Trails Diem Validator clusters. + +Andrew has been at Bison Trails for two years, and along with the other early engineers at Bison Trails, designed and implemented the go-to-market version of Bison Trails’ cluster management platform. + +#### Young Yang Liauw, Novi – Production Maintainer +Young is a technical lead for Developer Infrastructure at Novi. He works on the software development life cycle, developer experience, and Diem Ecosystem integration. + +Previously, he has been the technical lead and engineering manager across compiler and release engineering teams at Facebook. He was a researcher at Stanford University where he co-led a DARPA-funded project in non-volatile reconfigurable computing. He holds a Ph.D. in electrical engineering from Stanford University. + +#### Sherry Xiao, Novi – Production Maintainer +Sherry Xiao is a Production Engineer at Novi and has been leading the production readiness effort for the Diem Blockchain across several areas such as observability, debuggability, disaster recovery readiness, and incident response procedure. + +Previously, she has been the technical lead for Instagram’s “Infrastructure as a Service” initiative, and worked on scaling the Instagram web server fleet and Cassandra clusters. Sherry holds a master degree in computer science from Temple University. diff --git a/developers.diem.com/docs/move/move-basic-concepts.md b/developers.diem.com/docs/move/move-basic-concepts.md new file mode 100755 index 0000000000000..a987ceb46420c --- /dev/null +++ b/developers.diem.com/docs/move/move-basic-concepts.md @@ -0,0 +1,78 @@ +--- +title: "Basic concepts" +id: move-basic-concepts +hidden: false +--- + +