Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove BasisPoints in favor of rust_decimal #697

Closed
wants to merge 38 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
f787667
client: add a block query to print hash, height and time of a block
tzemanovic Oct 20, 2022
ca3608d
changelog: add #658
tzemanovic Oct 20, 2022
ea2d533
test/e2e/helpers: add a helper to query and parse block height
tzemanovic Oct 20, 2022
1285315
ci: invalide cf cache
Oct 24, 2022
0e57b7f
Modify specs
arafey Aug 15, 2022
0bd55bd
split back out the core VPs
tzemanovic Oct 21, 2022
5db5320
fix broken link
tzemanovic Oct 21, 2022
fa55961
ci: use mold linker
Oct 25, 2022
89fe10a
Update README.md
awasunyin Oct 26, 2022
97c5d4d
ci: fix mold usage
Oct 26, 2022
b3b2616
ci: fix workflow name
Oct 26, 2022
3952f18
replace floating point arithm from token module with rust_decimal
brentstone Aug 30, 2022
5fdc185
[ci] wasm checksums update
github-actions[bot] Oct 26, 2022
8730311
changelog: #436
tzemanovic Oct 26, 2022
282ff30
remove staking reward address from all code
brentstone Oct 25, 2022
d4eb5d5
remove staking reward address from genesis toml files
brentstone Oct 26, 2022
3024c30
[ci] wasm checksums update
github-actions[bot] Oct 26, 2022
c1fc428
client: remove staking rewards address from init-validator result
tzemanovic Oct 26, 2022
eb39d7c
wallet: remove validator rewards key
tzemanovic Oct 26, 2022
69480c8
remove staking rewards address from cli strings and docs strings
tzemanovic Oct 26, 2022
c356e0d
changelog: #687
tzemanovic Oct 26, 2022
365cd27
introduce validator commission rate and changes
brentstone Sep 21, 2022
081642e
require commission rate input data for new validators
brentstone Sep 23, 2022
e8c0f6e
epoched commission rate and tx for validator to change their rate
brentstone Sep 27, 2022
3947e17
commission rate: query + refactor validator change tx
brentstone Sep 28, 2022
5b1a09d
add missing commission rate-related instances
brentstone Oct 26, 2022
9d83fc8
include and update `rust_decimal`
brentstone Oct 26, 2022
fa06a5d
bug fix from splitting this PR off of #388
brentstone Oct 26, 2022
7a7d82a
cleaning: incl fmt + clippy
brentstone Oct 26, 2022
32722b1
init validator: default values for commission rate attributes (bug fix)
brentstone Oct 26, 2022
758da41
remove BasisPoints and change relevant parameters to Decimal type
brentstone Sep 8, 2022
0949b61
add fns to multiply Decimal and integer type, return truncated integer
brentstone Sep 8, 2022
9420915
more decimal_mult function uses
brentstone Sep 8, 2022
8546aa7
fix correct inner type of ValidationError::TotalVotingPowerTooLarge
brentstone Sep 12, 2022
5cadc76
clean comments and toml files of basis points
brentstone Oct 26, 2022
fd53b0e
use `decimal_mult` in some more places
brentstone Oct 26, 2022
37899ad
update rust_decimal version + fmt
brentstone Oct 26, 2022
8bed989
fix arb_amount to max out at max tm voting power (fix wasm test bug)
brentstone Oct 27, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changelog/unreleased/features/658-add-client-block-query.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Client: Add a command to query the last committed block's hash, height and
timestamp. ([#658](https://github.com/anoma/namada/issues/658))
2 changes: 2 additions & 0 deletions .changelog/unreleased/features/687-remove-staking-address.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- PoS: Removed staking reward addresses in preparation of auto-staked rewards
system. ([#687](https://github.com/anoma/namada/pull/687))
2 changes: 2 additions & 0 deletions .changelog/unreleased/improvements/436-remove-f64.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Refactored token decimal formatting.
([#436](https://github.com/anoma/namada/pull/436))
27 changes: 23 additions & 4 deletions .github/workflows/build-and-test-bridge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,13 @@ jobs:
matrix:
os: [ubuntu-latest]
nightly_version: [nightly-2022-05-20]
mold_version: [1.6.0]
make:
- name: ABCI
suffix: ''
cache_key: anoma
cache_version: v1
wait_for: anoma-release-eth (ubuntu-latest, ABCI Release build, anoma-e2e-release, v1)
wait_for: anoma-release-eth (ubuntu-latest, 1.6.0, ABCI Release build, anoma-e2e-release, v1)
tendermint_artifact: tendermint-unreleased-ad825dcadbd4b98c3f91ce5a711e4fb36a69c377

env:
Expand Down Expand Up @@ -177,19 +178,29 @@ jobs:
restore-keys: ${{ runner.os }}-${{ matrix.make.cache_key }}-${{ matrix.make.cache_version }}-cargo-
- name: Start sccache server
run: sccache --start-server
- name: Install mold linker
run: |
wget -q -O- https://github.com/rui314/mold/releases/download/v${{ matrix.mold_version }}/mold-${{ matrix.mold_version }}-x86_64-linux.tar.gz | tar -xz
mv mold-${{ matrix.mold_version }}-x86_64-linux/bin/mold /usr/local/bin
- name: Build
run: make build${{ matrix.make.suffix }}
env:
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=/usr/local/bin/mold"
- name: Build test
run: make build-test${{ matrix.make.suffix }}
env:
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=/usr/local/bin/mold"
- name: Download wasm artifacts
uses: actions/download-artifact@v3
with:
name: wasm-${{ github.sha }}
path: ./wasm
- name: Run unit test
run: make test-unit${{ matrix.make.suffix }}
env:
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=/usr/local/bin/mold"
- name: Wait for release binaries
uses: lewagon/wait-on-check-action@master
uses: lewagon/wait-on-check-action@@v1.2.0
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
check-name: ${{ matrix.make.wait_for }}
Expand Down Expand Up @@ -228,10 +239,11 @@ jobs:
ANOMA_TENDERMINT_WEBSOCKET_TIMEOUT: 20
ANOMA_E2E_USE_PREBUILT_BINARIES: "true"
ANOMA_E2E_KEEP_TEMP: "true"
ENV_VAR_TM_STDOUT: "false"
ANOMA_TM_STDOUT: "false"
ANOMA_LOG_COLOR: "false"
ANOMA_MASP_PARAMS_DIR: "/home/runner/work/masp"
ANOMA_LOG: "info"
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=/usr/local/bin/mold"
- name: Upload e2e logs
if: success() || failure()
uses: actions/upload-artifact@v3
Expand All @@ -240,7 +252,7 @@ jobs:
path: |
/tmp/.*/logs/
/tmp/.*/e2e-test.*/setup/validator-*/.anoma/logs/*.log
retention-days: 5
retention-days: 3
- name: Print sccache stats
if: always()
run: sccache --show-stats
Expand All @@ -255,6 +267,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
mold_version: [1.6.0]
make:
- name: ABCI Release build
suffix: ''
Expand Down Expand Up @@ -316,8 +329,14 @@ jobs:
restore-keys: ${{ runner.os }}-${{ matrix.make.cache_key }}-${{ matrix.make.cache_version }}-cargo-
- name: Start sccache server
run: sccache --start-server
- name: Install mold linker
run: |
wget -q -O- https://github.com/rui314/mold/releases/download/v${{ matrix.mold_version }}/mold-${{ matrix.mold_version }}-x86_64-linux.tar.gz | tar -xz
mv mold-${{ matrix.mold_version }}-x86_64-linux/bin/mold /usr/local/bin
- name: Build
run: make build-release${{ matrix.make.suffix }}
env:
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=/usr/local/bin/mold"
- name: Upload target binaries
uses: actions/upload-artifact@v3
with:
Expand Down
25 changes: 22 additions & 3 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,13 @@ jobs:
matrix:
os: [ubuntu-latest]
nightly_version: [nightly-2022-05-20]
mold_version: [1.6.0]
make:
- name: ABCI
suffix: ''
cache_key: anoma
cache_version: v1
wait_for: anoma-release (ubuntu-latest, ABCI Release build, anoma-e2e-release, v1)
wait_for: anoma-release (ubuntu-latest, 1.6.0, ABCI Release build, anoma-e2e-release, v1)
tendermint_artifact: tendermint-unreleased-ad825dcadbd4b98c3f91ce5a711e4fb36a69c377

env:
Expand Down Expand Up @@ -179,19 +180,29 @@ jobs:
restore-keys: ${{ runner.os }}-${{ matrix.make.cache_key }}-${{ matrix.make.cache_version }}-cargo-
- name: Start sccache server
run: sccache --start-server
- name: Install mold linker
run: |
wget -q -O- https://github.com/rui314/mold/releases/download/v${{ matrix.mold_version }}/mold-${{ matrix.mold_version }}-x86_64-linux.tar.gz | tar -xz
mv mold-${{ matrix.mold_version }}-x86_64-linux/bin/mold /usr/local/bin
- name: Build
run: make build${{ matrix.make.suffix }}
env:
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=/usr/local/bin/mold"
- name: Build test
run: make build-test${{ matrix.make.suffix }}
env:
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=/usr/local/bin/mold"
- name: Download wasm artifacts
uses: actions/download-artifact@v3
with:
name: wasm-${{ github.sha }}
path: ./wasm
- name: Run unit test
run: make test-unit${{ matrix.make.suffix }}
env:
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=/usr/local/bin/mold"
- name: Wait for release binaries
uses: lewagon/wait-on-check-action@master
uses: lewagon/wait-on-check-action@v1.2.0
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
check-name: ${{ matrix.make.wait_for }}
Expand Down Expand Up @@ -230,10 +241,11 @@ jobs:
ANOMA_TENDERMINT_WEBSOCKET_TIMEOUT: 20
ANOMA_E2E_USE_PREBUILT_BINARIES: "true"
ANOMA_E2E_KEEP_TEMP: "true"
ENV_VAR_TM_STDOUT: "false"
ANOMA_TM_STDOUT: "false"
ANOMA_LOG_COLOR: "false"
ANOMA_MASP_PARAMS_DIR: "/home/runner/work/masp"
ANOMA_LOG: "info"
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=/usr/local/bin/mold"
- name: Upload e2e logs
if: success() || failure()
uses: actions/upload-artifact@v3
Expand All @@ -257,6 +269,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
mold_version: [1.6.0]
make:
- name: ABCI Release build
suffix: ''
Expand Down Expand Up @@ -316,10 +329,16 @@ jobs:
~/.cargo/git
key: ${{ runner.os }}-${{ matrix.make.cache_key }}-${{ matrix.make.cache_version }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.make.cache_key }}-${{ matrix.make.cache_version }}-cargo-
- name: Install mold linker
run: |
wget -q -O- https://github.com/rui314/mold/releases/download/v${{ matrix.mold_version }}/mold-${{ matrix.mold_version }}-x86_64-linux.tar.gz | tar -xz
mv mold-${{ matrix.mold_version }}-x86_64-linux/bin/mold /usr/local/bin
- name: Start sccache server
run: sccache --start-server
- name: Build
run: make build-release${{ matrix.make.suffix }}
env:
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=/usr/local/bin/mold"
- name: Upload target binaries
uses: actions/upload-artifact@v3
with:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,21 @@ jobs:
command: cd documentation/specs && mdbook build
cache_subkey: specs
cache_version: v1
distribution_id: E2Y9R2H4P5LYED
- name: Build docs
folder: documentation/docs
bucket: namada-docs-static-website
command: cd documentation/docs && mdbook build
cache_subkey: docs
cache_version: v1
distribution_id: E2T9UML53913RV
- name: Build development docs
folder: documentation/dev
bucket: namada-dev-static-website
command: cargo run --bin namada_encoding_spec && cd documentation/dev && mdbook build
cache_subkey: dev
cache_version: v1
distribution_id: E6XPP5KFWXJFQ

env:
CARGO_INCREMENTAL: 0
Expand Down Expand Up @@ -127,6 +130,9 @@ jobs:
- name: Publish docs
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: aws s3 sync ${{ matrix.make.folder }}/book/html/ s3://${{ matrix.make.bucket }} --region eu-west-1 --delete
- name: Invalidate distribution cache
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: aws cloudfront create-invalidation --distribution-id ${{ matrix.make.distribution_id }} --paths "/*"
- name: Print sccache stats
if: always()
run: sccache --show-stats
Expand Down
16 changes: 16 additions & 0 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

## Overview

[Namada](http://namada.net) is a sovereign proof-of-stake blockchain, using Tendermint BFT
consensus, that enables multi-asset shielded transfers for any native
[Namada](http://namada.net) is a Proof-of-Stake L1 for interchain asset-agnostic privacy. Namada uses Tendermint BFT
consensus and enables multi-asset shielded transfers for any native
or non-native asset. Namada features full IBC protocol support,
a natively integrated Ethereum bridge, a modern proof-of-stake
system with automatic reward compounding and cubic slashing, and a
Expand Down
2 changes: 2 additions & 0 deletions apps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ tracing-subscriber = {version = "0.3.7", features = ["env-filter"]}
websocket = "0.26.2"
winapi = "0.3.9"
bimap = {version = "0.6.2", features = ["serde"]}
rust_decimal = "1.26.1"
rust_decimal_macros = "1.26.1"

[dev-dependencies]
namada = {path = "../shared", features = ["testing", "wasm-runtime"]}
Expand Down
6 changes: 6 additions & 0 deletions apps/src/bin/anoma-client/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ pub async fn main() -> Result<()> {
Sub::QueryEpoch(QueryEpoch(args)) => {
rpc::query_epoch(args).await;
}
Sub::QueryBlock(QueryBlock(args)) => {
rpc::query_block(args).await;
}
Sub::QueryBalance(QueryBalance(args)) => {
rpc::query_balance(ctx, args).await;
}
Expand All @@ -61,6 +64,9 @@ pub async fn main() -> Result<()> {
Sub::QueryVotingPower(QueryVotingPower(args)) => {
rpc::query_voting_power(ctx, args).await;
}
Sub::QueryCommissionRate(QueryCommissionRate(args)) => {
rpc::query_commission_rate(ctx, args).await;
}
Sub::QuerySlashes(QuerySlashes(args)) => {
rpc::query_slashes(ctx, args).await;
}
Expand Down
Loading