Skip to content
This repository has been archived by the owner on Jan 27, 2025. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: 0LNetworkCommunity/libra-legacy-v5
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v5.1.3-rc.4
Choose a base ref
...
head repository: 0LNetworkCommunity/libra-legacy-v5
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 16 commits
  • 314 files changed
  • 8 contributors

Commits on Jun 14, 2022

  1. [web-monitor] Add burn prefs to API (#1134)

    * add burn prefs to web-monitor api
    
    * update ui
    
    * change implementation
    0o-de-lally authored Jun 14, 2022
    Copy the full SHA
    7a15188 View commit details

Commits on Jul 25, 2022

  1. Release 5.1.3 (#1125)

    * downgrade error msg to info
    
    * cleanup unused prometheus log code
    
    * downgrade state sync error message to info
    
    * makefile for set-waypoint
    
    * patch makefile
    
    * refresh onchain state
    
    * genesis should assign vouches
    
    * set layout for devnet has 4 nodes
    
    * init val in genesis first
    
    * github repo tools can put file in genesis repo
    
    * save files to genesis repo
    
    * reorganize testnet scripts
    
    * cleanup
    
    * documentation
    
    * patch makefile
    
    * makefile
    
    * makefile
    
    * text [skip-ci]
    
    * update yaml configs so that node file uses multiple fullnode networks [skip-ci]
    
    * patch [skip ci]
    
    * patch ports [skip ci]
    
    * validator init on genesis and ol init, will use seed peers
    
    * trim whitespace on genesis_waypoint.txt
    
    * makefile
    
    * reverse state-sync default params
    
    * add helper in init to reset safety data
    
    * bump version
    
    * ol restore has --boundary-only or -b which will not attempt to restore an advanced version. This is the safest restore option.
    
    * ol restore defaults to only fetch the epoch boundary. --highest-version must be explicitly passed if the user wants versions beyond the epoch boundary (this is still experimental).
    
    * ol serve: deprecating the --run-checks or -c option. We now assume the user wants to run checks while running the web-monitor
    
    * improve error messages on safety rules initialize
    
    * validator should panic on trying to startup safety rules
    
    * patch
    
    * makefile
    
    * make testnet start with alice, bob, carol only
    
    * add execution.genesis_file_location to fullnode yaml
    
    * set layout to have 5 addresses for testnet genesis
    
    * alway use cargo release mode even in testnet
    
    * undo
    
    * update fixture files with ip addresses for reference.
    
    * patch validator yaml file generation
    
    * ol start doesn't need to swtich between validator and fullnode mode with the new configs!
    
    * make pubnet config use onchain discovery
    
    * remove setting for fullnode identity in validator file
    
    * rename ol restore option highest_version -> latest_version
    0o-de-lally authored Jul 25, 2022
    Copy the full SHA
    eb54e83 View commit details

Commits on Jul 26, 2022

  1. Copy the full SHA
    bc747d9 View commit details
  2. Release 5.1.3 (#1136)

    * merge with main
    
    * patch
    0o-de-lally authored Jul 26, 2022
    Copy the full SHA
    cba1a92 View commit details
  3. 📝 Log rotation (#1129)

    * updated hard mode validator onboarding documentation
    
    * minor fixes from review
    
    * log rotation with multilog added to validator onboarding docs
    
    * log rotation docu correction
    ownyrd authored Jul 26, 2022
    Copy the full SHA
    1fa8761 View commit details
  4. [tower] Allow tower to mine dynamic VDF parameters (#1111)

    * add vdf difficulty type in rust
    
    * refactor fetching local block
    
    * refactor mine once
    
    * refactor mine_once
    
    * remove depr tests
    
    * tests passing
    
    * move next_proof to own module
    
    * move vdf difficulty type
    
    * function to create next proof params from chain query
    
    * switch between local and online mode for proof generation
    
    * move code for allowing vdf praams to be stored instead  of hard coded.
    
    * add toy_rng for tower state
    
    * update VDF params at end of epoch
    
    * check correct security in period
    
    * cleanup
    
    * patch tower cli build
    
    * patch toy_rng for tests
    
    * patch tower app test
    
    * build stdlib
    
    * test passing
    
    * WIP make new miner methods work with swarm
    
    * tower can get difficulty params from chain
    
    * genesis to use test settings
    
    * fix loop and backlog issue
    
    * don't init difficulty at genesis
    
    * reorder genesis tx so testnet is initialized before genesis settings
    
    * patch merge
    
    * patch test
    
    * new towers will start from the baseline/genesis difficulty and security params
    
    * refactor default vdf params for block zero
    
    * update tests for toy_rng
    
    * test epoch creates random difficulty
    
    * catch error with len == 0
    
    * bad makefile
    
    * add test for continuous mining
    
    * scaffold gc for tower
    
    * scaffold
    
    * find first discontinous proof
    
    * collect subsequent proofs function
    
    * delete files
    
    * clean
    
    * backlog checks a bad tx for garbage collection
    
    * implement GC on failed proof
    
    * while transitioning to dynamic vdf, tower should failover to localmode
    
    * downgrade error msg to info
    
    * cleanup unused prometheus log code
    
    * downgrade state sync error message to info
    
    * makefile for set-waypoint
    
    * patch makefile
    
    * refresh onchain state
    
    * genesis should assign vouches
    
    * set layout for devnet has 4 nodes
    
    * init val in genesis first
    
    * github repo tools can put file in genesis repo
    
    * save files to genesis repo
    
    * reorganize testnet scripts
    
    * cleanup
    
    * documentation
    
    * documentation
    
    * patch makefile
    
    * patch makefile
    
    * rename make recipes
    
    * rename
    
    * vdf difficulties must always be even numbers
    
    * patch move
    
    * makefile
    
    * makefile
    
    * text [skip-ci]
    
    * update yaml configs so that node file uses multiple fullnode networks [skip-ci]
    
    * patch [skip ci]
    
    * patch ports [skip ci]
    
    * validator init on genesis and ol init, will use seed peers
    
    * trim whitespace on genesis_waypoint.txt
    
    * makefile
    
    * method to create  a genesis proof
    
    * reverse state-sync default params
    
    * add helper in init to reset safety data
    
    * bump version
    
    * ol restore has --boundary-only or -b which will not attempt to restore an advanced version. This is the safest restore option.
    
    * ol restore defaults to only fetch the epoch boundary. --highest-version must be explicitly passed if the user wants versions beyond the epoch boundary (this is still experimental).
    
    * ol serve: deprecating the --run-checks or -c option. We now assume the user wants to run checks while running the web-monitor
    
    * improve error messages on safety rules initialize
    
    * validator should panic on trying to startup safety rules
    
    * patch
    
    * makefile
    
    * make config chain-id and instance of namedchain, breaking
    
    * patch build
    
    * make chainId::str_to_chain_id public
    
    * parse namedchain from str
    
    * use testing ID in tx_params
    
    * make testnet start with alice, bob, carol only
    
    * add execution.genesis_file_location to fullnode yaml
    
    * set layout to have 5 addresses for testnet genesis
    
    * alway use cargo release mode even in testnet
    
    * undo
    
    * update fixture files with ip addresses for reference.
    
    * update check for prod settings for nextproof
    
    * VDF native function was aborting instead of returning error.
    
    * NextProof generate genesis proof from configs
    
    * add derive traits to nextproof
    
    * builds
    
    * refactor get_next_proof_from_chain [skip-ci]
    
    * patch test because chain_id options have changed
    
    * patch testtepoch_random_difficulty.move
    
    * refactor init and onboard to use new named chain property
    
    * patch copy of fixture files in swarm
    
    * patch wrong chainid for swarm
    
    * patch test mining epochs
    
    * patch chain_id build issues
    
    * include more namedchain str parsing options
    
    * tower: delete a vdf proof that cannot be parsed
    
    * debug ci
    0o-de-lally authored Jul 26, 2022
    Copy the full SHA
    4b6c05c View commit details

Commits on Jul 27, 2022

  1. Copy the full SHA
    f470204 View commit details

Commits on Jul 28, 2022

  1. Chore: Format tools (#1140)

    * format cli folder
    
    * format genesis-tools folder
    
    * format keys folder
    
    * format onboard folder
    
    * format tower folder
    
    * format txs folder
    
    * format types folder
    
    * format util folder
    
    * format verifiable_delay folder
    0xzoz authored Jul 28, 2022
    Copy the full SHA
    c95de9c View commit details

Commits on Jul 30, 2022

  1. Copy the full SHA
    4161831 View commit details

Commits on Aug 8, 2022

  1. Osx makefile support (#1149)

    * support osx shasum cli tool
    Leibniz137 authored Aug 8, 2022
    Copy the full SHA
    4aef437 View commit details

Commits on Aug 11, 2022

  1. [move] reduce thresholds on validators (#1152)

    * Move vouch constant to Globals, reduce to 2 vouchers per validator
    
    * move validator signing threshold to Globals, and reduce from 5% to 3%
    
    * patch testing defaults
    0o-de-lally authored Aug 11, 2022
    Copy the full SHA
    689cb94 View commit details
  2. [node] Don't panic on failure to initialize safety rules. (#1153)

    * failure to initialize safety rules should not stop the validator from starting, since the validator may be syncing. Note: THE VALIDATOR WILL NOT BE ABLE TO SIGN BLOCKS if the safety riles cannot be initialized.
    
    * patch build
    0o-de-lally authored Aug 11, 2022
    Copy the full SHA
    c6d6c65 View commit details

Commits on Aug 12, 2022

  1. Release 5.2.0 (#1154)

    * tower integration test should span many blocks and across epochs
    
    * patch makefile for teestnet
    
    * implement a deserializer for namedchain
    
    * update fixtures
    
    * increase state sync tick interval to prevent timeouts
    
    * separate stdlib from genesis in makefile recipe
    
    * change set layout
    
    * testnet genesis to have 4 nodes [skip-ci]
    
    * namedchain parsing
    
    * use the correct historical/baseline proof difficulty
    
    * patch tower baseline difficulty in Move code
    
    * Move bug in checking first proof in epoch
    
    * add dave prod mode proof
    
    * ... and stages
    
    * patch TowerState bug with non-test envs for checking proof submission
    
    * refector towerstate difficulty checking so that it applies to operator sent proofs.
    
    * patch bug where the epoch boundary failover should start from longest list of validators (validator universe)
    
    * add proof zero for eve
    0o-de-lally authored Aug 12, 2022
    Copy the full SHA
    7a5628b View commit details

Commits on Aug 23, 2022

  1. v5.20 Patches to Upgrade Oracle, and Writeset generators (#1155)

    * bump version number
    
    * changelog
    
    * format tower backlog error msg in edge case
    
    * Docs for rescue writesets
    
    * refactor epoch boundary counter reset in writeset builder
    
    * Upgrade oracle to have upgrade function to expire a vote
    
    * add vote revocation to Oracle Upgrade
    
    * fullnode subsidy aka Carpe towers get paid anyways during the recovery mode
    
    * recovery writeset should trigger the epoch counters to reset
    
    * set the oracle expiry window
    
    * add upgrade proposal expiration to rescue
    
    * bind to correct module in Oracle
    
    * patch writeset
    
    * add upgrade expiration cli command
    
    * make files
    
    * refactor oracle upgrade expire writeset
    
    * add txs helper for voting
    
    * revoke functional test, passing
    
    * deprecate fullnode payment in recovery mode test
    
    * revoking vote, should revoke delegates
    
    * test for revoking delegated votes
    
    * patch test
    
    * recovery mode uses the initial validators throughought the period
    
    * makefile set recovery epoch 295
    
    * including misko9's validator yaml configs
    
    * update StateSyncConfig parameters
    0o-de-lally authored Aug 23, 2022
    Copy the full SHA
    ac741e4 View commit details

Commits on Dec 25, 2022

  1. Copy the full SHA
    49435e7 View commit details
  2. Copy the full SHA
    44f6759 View commit details
Showing 314 changed files with 7,224 additions and 29,088 deletions.
5 changes: 2 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -11,6 +11,5 @@
*.txt text
*.yml text

# Use Rust syntax highlighter for Move and Move IR code
*.move linguist-language=Rust
*.mvir linguist-language=Rust
# Use Move syntax highlighter for Move IR code
*.mvir linguist-language=Move
3 changes: 3 additions & 0 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
@@ -35,6 +35,9 @@ jobs:
- name: MINING
run: RUSTC_WRAPPER=sccache SOURCE_PATH=./ make -f ol/integration-tests/test-mining.mk test

# - name: MINING ACROSS EPOCHS
# run: RUSTC_WRAPPER=sccache SOURCE_PATH=./ make -f ol/integration-tests/test-mining-epochs.mk test

- name: ONBOARD
run: RUSTC_WRAPPER=sccache SOURCE_PATH=./ make -f ol/integration-tests/test-onboard.mk test
- name: File permissions
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -64,4 +64,5 @@ key_store.json
*.swp

# prevent mv files from being committed
*.mv
*.mv
language/diem-framework/releases/
17 changes: 9 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

126 changes: 61 additions & 65 deletions Makefile
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ endif
# Registration params
REMOTE = 'backend=github;repository_owner=${GITHUB_USER};repository=${REPO_NAME};token=${DATA_PATH}/github_token.txt;namespace=${ACC}'

GENESIS_REMOTE = 'backend=github;repository_owner=${REPO_ORG};repository=${REPO_NAME};token=${DATA_PATH}/github_token.txt;namespace=${ACC}'
GENESIS_REMOTE = 'backend=github;repository_owner=${REPO_ORG};repository=${REPO_NAME};token=${DATA_PATH}/github_token.txt;namespace=${ACC};branch=master'

LOCAL = 'backend=disk;path=${DATA_PATH}/key_store.json;namespace=${ACC}'

@@ -92,7 +92,8 @@ bins: stdlib
stdlib:
# cargo run ${CARGO_ARGS} -p diem-framework
cargo run ${CARGO_ARGS} -p diem-framework -- --create-upgrade-payload
sha256sum language/diem-framework/staged/stdlib.mv
# linux uses sha265sum, but not available by default on OS X
bash -c "sha256sum language/diem-framework/staged/stdlib.mv || shasum -a 256 language/diem-framework/staged/stdlib.mv"


install: mv-bin bin-path
@@ -301,18 +302,14 @@ genesis:
--layout-path ${DATA_PATH}/set_layout.toml \
--val-ip-address ${IP}


sha256sum ${DATA_PATH}/genesis.blob
# linux uses sha265sum, but not available by default on OS X
bash -c "sha256sum ${DATA_PATH}/genesis.blob || shasum -a 256 ${DATA_PATH}/genesis.blob"

#### NODE MANAGEMENT ####
start:
# run in foreground. Only for testing, use a daemon for net.
RUST_LOG=error cargo run -p diem-node -- --config ${DATA_PATH}/validator.node.yaml

# Start a fullnode instead of a validator node
start-full:
cargo run -p diem-node -- --config ${DATA_PATH}/fullnode.node.yaml

daemon:
mkdir -p ~/.config/systemd/user/
cp ./ol/util/diem-node.service ~/.config/systemd/user/
@@ -401,18 +398,16 @@ ifdef TEST
cp ./ol/devnet/set_layout_test.toml ${DATA_PATH}/set_layout.toml
endif

fix-genesis:
cp ./ol/devnet/genesis/${V}/genesis.blob ${DATA_PATH}/
cp ./ol/devnet/genesis/${V}/genesis_waypoint ${DATA_PATH}/


#### HELPERS ####
set-waypoint:
@if test -f ${DATA_PATH}/key_store.json; then \
jq -r '. | with_entries(select(.key|match("-oper/waypoint";"i")))[].value' ${DATA_PATH}/key_store.json > ${DATA_PATH}/client_waypoint; \
jq -r '. | with_entries(select(.key|match("-oper/genesis-waypoint";"i")))[].value' ${DATA_PATH}/key_store.json > ${DATA_PATH}/genesis_waypoint; \
jq -r '. | with_entries(select(.key|match("-oper/genesis-waypoint";"i")))[].value' ${DATA_PATH}/key_store.json > ${DATA_PATH}/genesis_waypoint.txt; \
fi

cargo r -p ol -- init --update-waypoint --waypoint $(shell cat ${DATA_PATH}/client_waypoint)

@echo client_waypoint:
@cat ${DATA_PATH}/client_waypoint

@@ -450,71 +445,65 @@ debug:
make smoke-onboard <<< $$'${MNEM}'


##### DEVNET TESTS #####
#### TESTNET #####
# The testnet is started using the same tools as genesis to have a faithful reproduction of a network from a clean slate.

devnet: clear fix dev-wizard dev-genesis start
# runs a smoke test from fixtures.
# Uses genesis blob from fixtures, assumes 3 validators, and test settings.
# This will work for validator nodes alice, bob, carol, and any fullnodes; 'eve'
# 1. The first thing necessary is initializing testnet genesis validators. All genesis nodes need to set up environment variables for their namespace/personas e.g. NS=alice. Also the TEST=y mode must be set, as well as a chain environment e.g. NODE_ENV=test. These settings must be done manually, preferably in .bashrc

dev-join: clear fix fix-genesis dev-wizard
# REQUIRES MOCK GIT INFRASTRUCTURE: OLSF/dev-genesis OLSF/dev-epoch-archive
# see `devnet-archive` below
# We want to simulate the onboarding/new validator fetching genesis files from the mock archive: dev-genesis-archive
# 2. Next those validators will register config data to a github repo OLSD/dev-genesis. Note: there could be github http errors, if validators attempt to write the same resource simultaneously

# mock restore backups from dev-epoch-archive
rm -rf ~/.0L/restore
# restore from MOCK archive OLSF/dev-epoch-archive
cargo r -p ol -- restore
# start a node with fullnode.node.yaml configs
make start-full
# THESE STEPS ARE ACHIEVED WITH `make testnet-register`

dev-wizard:
# REQUIRES there is a genesis.blob in the fixtures/genesis/<version> you are testing
MNEM='${MNEM}' cargo run -p onboard -- val --prebuilt-genesis ${DATA_PATH}/genesis.blob --skip-mining --chain-id 1 --genesis-ceremony
# 3. Wait. All genesis nodes need to complete registration. Otherwise buidling a genesis.blob (the first block), will fail.
# 4. Each genesis node builds the genesis file locally, and submits to the github repo. (this remote genesis file is what subsequent non-genesis validators will use to bootstrap their db).
# 5. Genesis validators can start their nodes.

#### DEVNET RESTART ####
# usually do this on Alice, which has the dev-epoch-archive repo, and dev-genesis
# THESE STEPS ARE ACHIEVED WITH `make testnet`

# Do the ceremony: and also save the genesis fixtures, needs to happen before fix.
dev-register: clear fix dev-wizard gen-register
# Do a dev genesis on each node after EVERY NODE COMPLETED registration.
dev-genesis: genesis dev-save-genesis fix-genesis

#### DEVNET INFRA ####
# To make reproducible devnet files.
# 6. Assuming there is progress in the block production, subsequent validators can join.

# Save the files to mock infrastructure i.e. devnet github
dev-infra: dev-backup-archive dev-commit
# THIS IS ACHIEVED WITH: testnet-onboard

dev-save-genesis: set-waypoint
rsync -a ${DATA_PATH}/genesis* ${SOURCE}/ol/devnet/genesis/${V}/
git add ${SOURCE}/ol/devnet/genesis/${V}/

dev-backup-archive:
cd ${HOME}/dev-epoch-archive && make devnet-backup
#### 1. TESTNET SETUP ####

dev-commit:
git commit -a -m "save genesis fixtures to ${V}" | true
git push | true
testnet-init: clear fix
# REQUIRES there is a genesis.blob in the fixtures/genesis/<version> you are testing
MNEM='${MNEM}' cargo run -p onboard -- val --skip-mining --chain-id ${CHAIN_ID} --genesis-ceremony

# Do the genesis ceremony registration, this includes the step testnet-validator-init-wizard
testnet-register: testnet-init gen-register
# Do a dev genesis on each node after EVERY NODE COMPLETED registration.

# Makes the gensis file on each genesis validator, AND SAVES TO GITHUB so that other validators can be onboarded after genesis.
testnet-genesis: genesis set-waypoint
cargo run -p diem-genesis-tool ${CARGO_ARGS} -- create-repo \
--publish-genesis ${DATA_PATH}/genesis.blob \
--shared-backend ${GENESIS_REMOTE}

cargo run -p diem-genesis-tool ${CARGO_ARGS} -- create-repo \
--publish-genesis ${DATA_PATH}/genesis_waypoint.txt \
--shared-backend ${GENESIS_REMOTE}

#### 2. TESTNET START ####

# Do this to restart the network with new code. Assumes a registration has been completed, and the genesis validators are unchanged. If new IP addresses or number of genesis nodes changed, you must RERUN SETUP below.
# - builds stdlib from source
# - clears many of the home files
# - adds fixtures
# - initializes node configs
# - rebuids genesis files and shares to github genesis repo
# - starts node in validator mode
testnet: clear fix testnet-init testnet-genesis start

# For subsequent validators joining the testnet. This will fetch the genesis information saved
testnet-onboard: clear
MNEM='${MNEM}' cargo run -p onboard -- val --github-org OLSF --repo dev-genesis --chain-id ${CHAIN_ID}
# start a node with fullnode.node.yaml configs
cargo r -p diem-node -- -f ~/.0L/fullnode.node.yaml

TAG=$(shell git tag -l "previous")
clean-tags:
git push origin --delete ${TAG}
git tag -d ${TAG}

nuke-testnet:
@echo WIPING EVERYTHING but keeping: github_token.txt, autopay_batch.json, set_layout.toml, /vdf_proofs/proof_0.json

@if test -d ${DATA_PATH}; then \
cd ${DATA_PATH} && cp github_token.txt autopay_batch.json set_layout.toml vdf_proofs/proof_0.json ~/; \
cd ${DATA_PATH} && rm -rf *; \
cd ~ && cp github_token.txt autopay_batch.json set_layout.toml ${DATA_PATH}; \
cd ${DATA_PATH} && mkdir vdf_proofs;\
cd ~ && cp proof_0.json ${DATA_PATH}/vdf_proofs/; \
fi


####### SWARM ########

@@ -566,6 +555,13 @@ fork-config:
cargo run -p onboard -- fork -u http://167.172.248.37 --prebuilt-genesis ${DATA_PATH}/genesis_from_snapshot.blob

# start node from files
fork-start:
fork-start:
rm -rf ~/.0L/db
cargo run -p libra-node -- --config ~/.0L/validator.node.yaml

##### UTIL #####
TAG=$(shell git tag -l "previous")
clean-tags:
git push origin --delete ${TAG}
git tag -d ${TAG}

10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ We live 24/7 on Discord [join us there](https://discord.gg/AzCp63pggW).

Read our documentation [here](ol/documentation/README.md).

Skip straight to [toubleshooting onboarding a node to network.](ol/documentation/node-ops/validators/troubleshoting_onboarding.md)
Skip straight to [troubleshooting onboarding a node to network.](ol/documentation/node-ops/validators/troubleshoting_onboarding.md)

Contribute to [issues](https://github.com/OLSF/libra/issues).

@@ -43,7 +43,7 @@ This is a non-exhaustive summary of the key features of the Diem architecture th
The smart-contract language of the platform is called Move. It is the most unique breakthrough of the team. This is a language that is designed to be extremely safe in adversarial environments, and for hurried, less experienced developers. It's a very ergonomic language, it's easy to approach it if you have even entry-level coding experience. In terms of safety it incorporates much from the Rust language concepts of "borrowing" memory. The compiler is pretty obnoxious, which is something you want when designing autonomous financial systems. One standout feature of the Move language is built-in Formal Verification. Adjacent to the code you can write specs for invariants which your code must preserve (i.e. this function should never be called by this type of account), and it can be checked during the development and build process. This is unique and powerful.

### Programming model
The execution of the smart contract and scripts has some subtle but important safety features. By design what are referred to in other platforms as smart-contracts are in fact "modules" here. Users can publish modules, which any other module or transaction can import. This is important. The transactions are scripts. So compared to Ethereum, much of what happens in a smart contract, can actually be split into long lived code in a module, and transaction-scripts which can import from the module (and other modules). This decoupling allows for powerful composability and reliability. The developer can evolve the application without necessarily needing to upgrade modules every time a new transaction use-case emerges.
The execution of the smart contract and scripts has some subtle but important safety features. By design what are referred to in other platforms as smart contracts are in fact "modules" here. Users can publish modules, which any other module or transaction can import. This is important. The transactions are scripts. So compared to Ethereum, much of what happens in a smart contract, can actually be split into long-lived code in a module, and transaction-scripts which can import from the module (and other modules). This decoupling allows for powerful composability and reliability. The developer can evolve the application without necessarily needing to upgrade modules every time a new transaction use case emerges.

Modules can have "resources" bound to them. A resource can be thought of as an object in memory, but with restrictions: they can only be modified by the module that instantiated them, and are restricted in how they get created and transferred. Writing a non-fungible token is basically just instantiating one such structure, and something like a fungible token, can be done in a handful of lines of code.

@@ -75,7 +75,7 @@ The technology we are inheriting is a spaceship. It is also purely infrastructur

But most importantly, the architecture is designed as a private, consortium chain.

For system administration, there is on omnipresent Diem Association account. Yes, a private key that controls many functions including: Freezing accounts (!), selecting validators for inclusion, paying transaction fees to validators, upgrading the system code. This is obviously a non-starter. So a lot of work had to go into making system policies execute in a permissionless environment.
For system administration, there is an omnipresent Diem Association account. Yes, a private key that controls many functions including: Freezing accounts (!), selecting validators for inclusion, paying transaction fees to validators, upgrading the system code. This is obviously a non-starter. So a lot of work had to go into making system policies execute in a permissionless environment.

We also had to add Sybil resistance mechanisms. Typically communities have been choosing Proof-of-Stake as the Sybil resistance method for BFT networks. This is not the route we chose given community growth considerations (as well as regulatory). Elsewhere we've talked in detail about our Delay Towers complement to consensus.

@@ -134,10 +134,10 @@ We've made some additions to the MoveVM that were necessary for us to implement

- Decimal - we needed a number type that could be used for financial math that could lead into polynomial curves etc. So we added the Rust Decimal library and some initial APIs and their corresponding native instructions.

- VDF verification - to verify the Delay Towers proofs we added the ChiaVDF verifier to the VM. The prover is not needed in the VM. The VDF prover can accept a number of parameters (not hardcoded for 0L's use-case). So application builders could leverage it in their own games.
- VDF verification - to verify the Delay Towers proofs we added the ChiaVDF verifier to the VM. The prover is not needed in the VM. The VDF prover can accept a number of parameters (not hardcoded for 0L's use case). So application builders could leverage it in their own games.

### Auto Pay
The ability to create payments in the future, and regular payments as a percent of account balance or of new income. This was a feature requested early by the community. It powers a number of use-cases important at the start of a network.
The ability to create payments in the future, and regular payments as a percent of account balance or of new income. This was a feature requested early by the community. It powers a number of use cases important at the start of a network.
Namely it is useful for anyone that wants to run a community program. In this case an entity or a person is seeking to accomplish a goal or a project, and is asking for donations. Autopay allows for set-it-and-forget-it donations to programs. Most people in 0L use this to send a portion of their mining rewards to programs automatically.

Autopay can be programmed for:
2 changes: 1 addition & 1 deletion config/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "diem-config"
version = "5.1.2"
version = "5.2.0"
authors = ["Diem Association <opensource@diem.com>"]
description = "Diem diem-config"
repository = "https://github.com/diem/diem"
5 changes: 2 additions & 3 deletions config/global-constants/src/lib.rs
Original file line number Diff line number Diff line change
@@ -35,18 +35,17 @@ pub const PROOF_OF_WORK_PROOF: &str = "pow_proof";
pub const ACCOUNT_PROFILE: &str = "account_profile";
pub const SALT_0L: &str = "0L";
pub const SOURCE_DIR: &str = "libra/";
pub const VDF_SECURITY_PARAM: u16 = 512;
pub const GENESIS_VDF_SECURITY_PARAM: u64 = 512;

/// Filename for 0L configs
pub const CONFIG_FILE: &str = "0L.toml";
pub const DEFAULT_VAL_PORT: u64 = 6180;
pub const DEFAULT_VFN_PORT: u64 = 6179;
pub const DEFAULT_PUB_PORT: u64 = 6178;


// TODO: make this lazy static.
/// Switch settings between production and testing
pub fn delay_difficulty() -> u64 {
pub fn genesis_delay_difficulty() -> u64 {
let node_env = match env::var("NODE_ENV") {
Ok(val) => val,
_ => "prod".to_string() // default to "prod" if not set
2 changes: 1 addition & 1 deletion config/management/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "diem-management"
version = "5.1.2"
version = "5.2.0"
authors = ["Diem Association <opensource@diem.com>"]
description = "Diem Management is a tool used to manage the configuration of a Diem Node"
repository = "https://github.com/diem/diem"
1 change: 1 addition & 0 deletions config/management/genesis/Cargo.toml
Original file line number Diff line number Diff line change
@@ -47,6 +47,7 @@ serde_json = "1"
diem-github-client = { path = "../../../secure/storage/github" }
ol-types = {path = "../../../ol/types"}
serde_yaml = "0.8.17"
base64 = "0.13.0"

[dev-dependencies]
diem-config = { path = "../..", features = ["fuzzing"]}
Loading