Skip to content

Commit

Permalink
Merge #3106
Browse files Browse the repository at this point in the history
3106: Initial support for private chain r=mpapierski a=mpapierski

This is backport of original #3029 on top of v1.4.6 with least amount of extra backported changes to make the original code from PR unchanged.


This PR brings preliminary support for private chains by introducing multiple chainspec configuration flags that change the behavior of a chain.

These settings are orthogonal to each other; any particular combination (and all other pre-existing settings) is valid for a given network, for a wide variety of possible permutations. 

- Administrator accounts: by specifying accounts in a `[[administrators]]` section of `accounts.toml` accounts with special privileges are created and later referred to as 'administrative accounts'
- `core.allow_auction_bids` disables add_bid, delegate entrypoints in auction contract if set to true
- `core.compute_rewards` rewards 0 tokens after each switch block. This means no new tokens are minted and validators aren't gaining more weight.
- `core.allow_unrestricted_transfers` if set to false, the normal user can't send tokens to other normal users; the normal user can transfer only to the administrator; either source or target has to be an admin.
- `core.refund_handling` defines how refunds are computed. 
  - `refund_handling = { type = "refund", refund_ratio = [1, 1] }` means 100% of `payment_amount - gas_spent` is refunded. 
  - `refund_handling = { type = "refund", refund_ratio = [0, 100 ] }` doesn't refund anything
  - `Refund` mode requires that the fraction specified is proper fraction (that is `refund_ratio <= 1`)
- `core.fee_handling` defines how gas spent is processed after deploy is executed.
  - `fee_handling = { type = "accumulate" }` creates special rewards purse in the mint system contract where fees are accumulated into
  - `fee_handling = { type = "pay_to_proposer" }` is a default setting for a public chain - rewards are transferred to block's proposer.
  - `fee_handling = { type = "burn" }` fees are burned.


Co-authored-by: Michał Papierski <[email protected]>
  • Loading branch information
casperlabs-bors-ng[bot] and Michał Papierski authored Jun 15, 2022
2 parents 6e1f65e + e35e834 commit 4f9a59e
Show file tree
Hide file tree
Showing 244 changed files with 11,723 additions and 2,091 deletions.
82 changes: 82 additions & 0 deletions Cargo.lock

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

7 changes: 7 additions & 0 deletions ci/nightly-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ start_run_teardown "itst07.sh"
start_run_teardown "itst11.sh"
start_run_teardown "itst13.sh"
start_run_teardown "itst14.sh"
start_run_teardown "itst01_private_chain.sh"
start_run_teardown "itst02_private_chain.sh"
start_run_teardown "itst06_private_chain.sh"
start_run_teardown "itst07_private_chain.sh"
start_run_teardown "itst11_private_chain.sh"
# start_run_teardown "itst13_private_chain.sh"
# start_run_teardown "itst14_private_chain.sh"
start_run_teardown "bond_its.sh"
start_run_teardown "emergency_upgrade_test.sh"
start_run_teardown "emergency_upgrade_test_balances.sh"
Expand Down
Loading

0 comments on commit 4f9a59e

Please sign in to comment.