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

Testnet fees #962

Merged
merged 6 commits into from
Jan 10, 2023
Merged

Testnet fees #962

merged 6 commits into from
Jan 10, 2023

Conversation

grarco
Copy link
Collaborator

@grarco grarco commented Dec 23, 2022

Closes #958

Implements a simplified fee system to mitigate DOS

tzemanovic
tzemanovic previously approved these changes Dec 26, 2022
@tzemanovic
Copy link
Member

On a second thought, I think this will prevent from withdrawing from faucet, unless you already have some balance. Not sure if that's what we want

@grarco
Copy link
Collaborator Author

grarco commented Dec 27, 2022

That's correct, at the moment this PR needs two things:

  1. Define a sensible amount of the fee: it's currently at 100 micro NAMs but faucet releases up to 1000 NAM per request so we should probably raise this
  2. Find a way to allow withdrawal from faucet

Regarding the second point, an idea could be this: in the three checks that we perform, when trying to access the balance of an account the first time the key is not in storage and we default to 0. For the testnet only we could change this default to be a minimum amount to allow the user to run the first transaction (ideally withdrawing from faucet)

@tzemanovic
Copy link
Member

1. Define a sensible amount of the fee: it's currently at 100 micro NAMs but faucet releases up to 1000 NAM per request so we should probably raise this

With the faucet withdrawal PoW (#961), we can set faucet_pow_difficulty in genesis - it takes around a minute with difficulty 3 to solve. I'd say we can safely allow up to ~100 txs from that. Let me make the faucet limit configurable from genesis too, so we can control this with it and we can set it to 10_000 micro NAM.

2. Find a way to allow withdrawal from faucet

Regarding the second point, an idea could be this: in the three checks that we perform, when trying to access the balance of an account the first time the key is not in storage and we default to 0. For the testnet only we could change this default to be a minimum amount to allow the user to run the first transaction (ideally withdrawing from faucet)

Yeah, some along this line sounds good - I think we can introduce a "mainnet" feature, which we'll need for other things and allow faucet withdrawal with PoW without fees when not(feature = "mainnet")

@tzemanovic tzemanovic mentioned this pull request Dec 28, 2022
8 tasks
tzemanovic added a commit that referenced this pull request Dec 28, 2022
* origin/grarco/basic-fee:
  changelog: add #962
  Fixes unit tests
  Fixes process proposal fee token
  Fixes fee value in tx contruction
  Adds fee burning and checks
  changed to 0.12.2
  Namada 0.12.2
  release: cherry-pick release improvements
  changelog: add #952
  prepare_proposal: update comment to reflect hotfix
  prepare_proposal: use TxRecord struct on ABCI++ build
  missed a chain-id addition
  Prioritize wrapper txs during proposal construction
  Hot fix PrepareProposal
  added chain id and fixed install docs
  update pseudocode
  General housekeeping
  Reward distribution: general improvements
  Cubic slashing: general writing improvements
  Cubic slashing: add new improved pseudocode blurb (Rust-style)
  Cubic slashing: clarify slash iteration procedure and equation
  Cubic slashing: fix and improve plot
  quick fix to cubic slash
  changelog: add #911
  changelog: add #876
  test/core: run less cases on `update_epoch_after_its_duration` test
  changelog: add #945
  ci: install cargo-about on release step
  make-package.sh: include license information in tarball
  release: add configuration for cargo-about
  changelog: add #943
  make-package.sh: don't attempt to include matchmaker
  Namada 0.12.1
  changelog: add #942
  vp_verify_masp: avoid panicking unwrap()s
  changed the docker link (again)
  Changed the first header of pages to H1 in 2 occasions in Namada Specs
  Replaced non-breaking space with space to fix faulty formatting
  fix transfer args
@tzemanovic tzemanovic mentioned this pull request Dec 30, 2022
@juped juped merged commit 2215a72 into main Jan 10, 2023
@juped juped deleted the grarco/basic-fee branch January 10, 2023 08:54
@grarco grarco mentioned this pull request Jan 11, 2023
4 tasks
juped added a commit that referenced this pull request Jan 11, 2023
Namada 0.13.0

* tag 'v0.13.0': (166 commits)
  Namada 0.13.0
  finalize_block: remove unused import
  misc: change log level
  misc: change log level
  chore: missing file
  ledger: add some blocks statistics logs
  changelog: add #972
  chore: clippy/fmt
  ledger: remove/changed some logs
  ledger: use genesis fees
  genesis: added parameter to control wrapper tx fees amount
  wasm: update checksums.json
  changelog: add #969
  test/e2e: add a case to withdraw from PoW faucet
  client/tx and signing: add wrapper signer balance check and add PoW
  ledger/queries/vp: add testnet pow and faucet methods
  wasm/vp_testnet_faucet: check PoW, use withdrawal_limit set in storage
  expose the `has_valid_pow` result via VP wasm host env
  validate PoW in mempool, proposal and finalize and keep the result
  shell/init_chain: init faucet storage, if used
  add `faucet_account` parameter and set it from `init_chain` if found
  genesis: add faucet_pow_difficulty and faucet_withdrawal_limit
  add "mainnet" feature flag, off by default for now
  storage_api/lazy_map: export `get_data_key` fn for client
  core/ledger: add testnet_pow module
  re-export `namada` from `namada_tests` for `namada_core` dev-deps
  changelog: add #903
  changelog: add #975
  wasm: update checksums.json
  Fix consensus params config for ABCI++
  wasm: update checksums.json
  Remove boilerplate code in favor of StorageKeys macro
  Update Cargo deps
  Define Keys struct with all ledger param key types
  Fix #882
  changelog: add #926
  changelog: add #974
  changelog: add #973
  wasm: update checksums.json
  Update documentation/docs/src/user-guide/ibc.md
  added ibc docs and new favicon
  Update README.md
  Update README.md
  changelog: add #965
  remove `ChangeIsZero` error
  remove dbg statements
  fix arb rate: prevent same rate and ensure proper bounds
  Revert "Merge pull request #965 from anoma/brent/fix-validator-commission-change-test"
  ci: fix e2e test script
  Reduces block size to 5 MiB
  Add `max_proposal_bytes` ledger param
  Moves ledger sleep
  Refactors ledger sleep
  Adds start time argument to namada ledger
  Update README.md
  Adds  const and default token to basic fee
  changelog: add #968
  add `NAMADA_LOG_FMT` env var with one of: full (default), json or pretty
  [ci] wasm checksums update
  core/storage: remove redundant `StorageWrite` impl for mut ref
  changelog: #966
  core/storage_api: use GATs to hide lifetime in StorageRead trait
  changelog: add #962
  changelog: add #965
  remove `ChangeIsZero` error
  remove dbg statements
  fix arb rate: prevent same rate and ensure proper bounds
  Fixes unit tests
  Fixes process proposal fee token
  Fixes fee value in tx contruction
  Adds fee burning and checks
  core/storage/mockDB: remove unused `reverse_order` flag
  Add JSON as an option for logging by env var
  changed to 0.12.2
  ci: install cargo-about after sccache server up
  Namada 0.12.2
  release: cherry-pick release improvements
  changelog: add #952
  prepare_proposal: update comment to reflect hotfix
  prepare_proposal: use TxRecord struct on ABCI++ build
  missed a chain-id addition
  Prioritize wrapper txs during proposal construction
  Hot fix PrepareProposal
  added chain id and fixed install docs
  update pseudocode
  General housekeeping
  Reward distribution: general improvements
  Cubic slashing: general writing improvements
  Cubic slashing: add new improved pseudocode blurb (Rust-style)
  Cubic slashing: clarify slash iteration procedure and equation
  Cubic slashing: fix and improve plot
  quick fix to cubic slash
  wasm: update checksums.json
  changelog: add #911
  changelog: add #876
  test/core: run less cases on `update_epoch_after_its_duration` test
  Update link to install section
  changelog: add #945
  ci: install cargo-about on release step
  make-package.sh: include license information in tarball
  ...
juped added a commit that referenced this pull request Jan 12, 2023
Namada 0.13.0

* tag 'v0.13.0': (166 commits)
  Namada 0.13.0
  finalize_block: remove unused import
  misc: change log level
  misc: change log level
  chore: missing file
  ledger: add some blocks statistics logs
  changelog: add #972
  chore: clippy/fmt
  ledger: remove/changed some logs
  ledger: use genesis fees
  genesis: added parameter to control wrapper tx fees amount
  wasm: update checksums.json
  changelog: add #969
  test/e2e: add a case to withdraw from PoW faucet
  client/tx and signing: add wrapper signer balance check and add PoW
  ledger/queries/vp: add testnet pow and faucet methods
  wasm/vp_testnet_faucet: check PoW, use withdrawal_limit set in storage
  expose the `has_valid_pow` result via VP wasm host env
  validate PoW in mempool, proposal and finalize and keep the result
  shell/init_chain: init faucet storage, if used
  add `faucet_account` parameter and set it from `init_chain` if found
  genesis: add faucet_pow_difficulty and faucet_withdrawal_limit
  add "mainnet" feature flag, off by default for now
  storage_api/lazy_map: export `get_data_key` fn for client
  core/ledger: add testnet_pow module
  re-export `namada` from `namada_tests` for `namada_core` dev-deps
  changelog: add #903
  changelog: add #975
  wasm: update checksums.json
  Fix consensus params config for ABCI++
  wasm: update checksums.json
  Remove boilerplate code in favor of StorageKeys macro
  Update Cargo deps
  Define Keys struct with all ledger param key types
  Fix #882
  changelog: add #926
  changelog: add #974
  changelog: add #973
  wasm: update checksums.json
  Update documentation/docs/src/user-guide/ibc.md
  added ibc docs and new favicon
  Update README.md
  Update README.md
  changelog: add #965
  remove `ChangeIsZero` error
  remove dbg statements
  fix arb rate: prevent same rate and ensure proper bounds
  Revert "Merge pull request #965 from anoma/brent/fix-validator-commission-change-test"
  ci: fix e2e test script
  Reduces block size to 5 MiB
  Add `max_proposal_bytes` ledger param
  Moves ledger sleep
  Refactors ledger sleep
  Adds start time argument to namada ledger
  Update README.md
  Adds  const and default token to basic fee
  changelog: add #968
  add `NAMADA_LOG_FMT` env var with one of: full (default), json or pretty
  [ci] wasm checksums update
  core/storage: remove redundant `StorageWrite` impl for mut ref
  changelog: #966
  core/storage_api: use GATs to hide lifetime in StorageRead trait
  changelog: add #962
  changelog: add #965
  remove `ChangeIsZero` error
  remove dbg statements
  fix arb rate: prevent same rate and ensure proper bounds
  Fixes unit tests
  Fixes process proposal fee token
  Fixes fee value in tx contruction
  Adds fee burning and checks
  core/storage/mockDB: remove unused `reverse_order` flag
  Add JSON as an option for logging by env var
  changed to 0.12.2
  ci: install cargo-about after sccache server up
  Namada 0.12.2
  release: cherry-pick release improvements
  changelog: add #952
  prepare_proposal: update comment to reflect hotfix
  prepare_proposal: use TxRecord struct on ABCI++ build
  missed a chain-id addition
  Prioritize wrapper txs during proposal construction
  Hot fix PrepareProposal
  added chain id and fixed install docs
  update pseudocode
  General housekeeping
  Reward distribution: general improvements
  Cubic slashing: general writing improvements
  Cubic slashing: add new improved pseudocode blurb (Rust-style)
  Cubic slashing: clarify slash iteration procedure and equation
  Cubic slashing: fix and improve plot
  quick fix to cubic slash
  wasm: update checksums.json
  changelog: add #911
  changelog: add #876
  test/core: run less cases on `update_epoch_after_its_duration` test
  Update link to install section
  changelog: add #945
  ci: install cargo-about on release step
  make-package.sh: include license information in tarball
  ...
bengtlofgren pushed a commit that referenced this pull request May 11, 2023
@grarco grarco mentioned this pull request Jun 29, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement a simple fee system
3 participants