From 848fc789759284fd5d383b5214257887a8c78575 Mon Sep 17 00:00:00 2001 From: Ondra Chaloupka Date: Wed, 10 Jul 2024 12:56:08 +0200 Subject: [PATCH] [changelog] preparation for contract v2.0.0 --- CHANGELOG.md | 23 ++++++++++++++++++ packages/validator-bonds-cli/README.md | 32 +++++++++++++++----------- programs/validator-bonds/README.md | 5 ++-- settlement-pipelines/README.md | 3 +-- 4 files changed, 46 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2dd6ae1a..b528ae21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,29 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## contract release v2.0.0 (2024-07-X) + +* address: [`vBoNdEvzMrSai7is21XgVYik65mqtaKXuSdMBJ1xkW4`](https://explorer.solana.com/address/vBoNdEvzMrSai7is21XgVYik65mqtaKXuSdMBJ1xkW4) +* tag: [`contract-v2.0.0`](https://github.com/marinade-finance/validator-bonds/releases/tag/contract-v2.0.0), commit: [`TODO`](https://github.com/marinade-finance/validator-bonds/commit/TODO), +* tx: [`TODO`](https://explorer.solana.com/tx/TODO) +* anchor verify command: + ``` + git checkout TODO &&\ + anchor verify --provider.cluster mainnet -p validator_bonds \ + --env "GIT_REV=`git rev-parse --short HEAD`" --env 'GIT_REV_NAME=v2.0.0' vBoNdEvzMrSai7is21XgVYik65mqtaKXuSdMBJ1xkW4 + ``` + +### Breaking updates + +* `SettlementClaim` account is not about to be used anymore. Deduplication of claiming will not be made with creating the PDA account + but using bitmap data structure in account `SettlementClaims` ([PR#73](https://github.com/marinade-finance/validator-bonds/pull/73/)) + +### Updates + +* `fund_bond` instruction permits to fund `StakeAccount` in state `Activating` and not only fully activated stake accounts ([PR#74](https://github.com/marinade-finance/validator-bonds/pull/74)) +* `claim_settlement` instruction permits to withdraw amount of SOL when exactly matching the size of the `StakeAccount` ([PR#70](https://github.com/marinade-finance/validator-bonds/pull/70)) + + ## TS CLI&SDK [1.5.3](https://github.com/marinade-finance/validator-bonds/compare/v1.5.2...v1.5.3) (2024-06-30) ### Fixes diff --git a/packages/validator-bonds-cli/README.md b/packages/validator-bonds-cli/README.md index 2a45128f..76cfa517 100644 --- a/packages/validator-bonds-cli/README.md +++ b/packages/validator-bonds-cli/README.md @@ -58,10 +58,9 @@ solana-keygen grind --starts-with bnd:1 solana create-stake-account # To couple the created stake account with the vote account +# This causes the stake account to be in the Activating state. solana delegate-stake - - # Funding Bond by assigning the stake account with the SOL amount in it validator-bonds fund-bond --stake-account @@ -242,7 +241,7 @@ when a validator under-performs or experiences a serious issue. The funded stake account: - **Must be delegated** to the vote account belonging to the bond account. -- **Must be fully activated**. +- **Must be activating or activated**. All lamports held in the stake accounts are considered part of the protected stake amount. @@ -504,14 +503,17 @@ Options: -V, --version output the version number -u, --cluster solana cluster URL or a moniker (m/mainnet/mainnet-beta, d/devnet, t/testnet, l/localhost) (default: "mainnet") -c alias for "-u, --cluster" - -k, --keypair Wallet keypair (path or ledger url in format usb://ledger/[][?key=]). Wallet keypair is used to pay for the transaction fees and as default value for signers. (default: loaded from solana - config file or ~/.config/solana/id.json) + -k, --keypair Wallet keypair (path or ledger url in format usb://ledger/[][?key=]). Wallet keypair is used to pay for the transaction fees + and as default value for signers. (default: loaded from solana config file or ~/.config/solana/id.json) --program-id Program id of validator bonds contract (default: vBoNdEvzMrSai7is21XgVYik65mqtaKXuSdMBJ1xkW4) -s, --simulate Simulate (default: false) - -p, --print-only Print only mode, no execution, instructions are printed in base64 to output. This can be used for placing the admin commands to SPL Governance UI by hand. (default: false) - --skip-preflight Transaction execution flag "skip-preflight", see https://solanacookbook.com/guides/retrying-transactions.html#the-cost-of-skipping-preflight (default: false) + -p, --print-only Print only mode, no execution, instructions are printed in base64 to output. This can be used for placing the admin commands to SPL Governance UI + by hand. (default: false) + --skip-preflight Transaction execution flag "skip-preflight", see https://solanacookbook.com/guides/retrying-transactions.html#the-cost-of-skipping-preflight + (default: false) --commitment Commitment (default: "confirmed") - --confirmation-finality Confirmation finality of sent transaction. Default is "confirmed" that means for majority of nodes confirms in cluster. "finalized" stands for full cluster finality that takes ~8 seconds. (default: "confirmed") + --confirmation-finality Confirmation finality of sent transaction. Default is "confirmed" that means for majority of nodes confirms in cluster. "finalized" stands for + full cluster finality that takes ~8 seconds. (default: "confirmed") --with-compute-unit-price Set compute unit price for transaction, in increments of 0.000001 lamports per compute unit. (default: 10) -d, --debug Printing more detailed information of the CLI execution (default: false) -v, --verbose alias for --debug (default: false) @@ -520,22 +522,26 @@ Options: Commands: init-config [options] Create a new config account. configure-config [options] [address] Configure existing config account. - mint-bond [options]
Mint a Validator Bond token, providing a means to configure the bond account without requiring a direct signature for the on-chain transaction. The workflow is as follows: first, use this "mint-bond" to mint a - bond token to the validator identity public key. Next, transfer the token to any account desired. Finally, utilize the command "configure-bond --with-token" to configure the bond account. + mint-bond [options]
Mint a Validator Bond token, providing a means to configure the bond account without requiring a direct signature for the on-chain transaction. + The workflow is as follows: first, use this "mint-bond" to mint a bond token to the validator identity public key. Next, transfer the token to + any account desired. Finally, utilize the command "configure-bond --with-token" to configure the bond account. init-bond [options] Create a new bond account. configure-bond [options]
Configure existing bond account. merge-stake [options] Merging stake accounts belonging to validator bonds program. fund-bond [options]
Funding a bond account with amount of SOL within a stake account. - init-withdraw-request [options] [address] Initializing withdrawal by creating a request ticket. The withdrawal request ticket is used to indicate a desire to withdraw the specified amount of lamports after the lockup period expires. + init-withdraw-request [options] [address] Initializing withdrawal by creating a request ticket. The withdrawal request ticket is used to indicate a desire to withdraw the specified amount + of lamports after the lockup period expires. cancel-withdraw-request [options] [address] Cancelling the withdraw request account, which is the withdrawal request ticket, by removing the account from the chain. - claim-withdraw-request [options] [address] Claiming an existing withdrawal request for an existing on-chain account, where the lockup period has expired. Withdrawing funds involves transferring ownership of a funded stake account to the specified - "--withdrawer" public key. To withdraw, the authority signature of the bond account is required, specified by the "--authority" parameter (default wallet). + claim-withdraw-request [options] [address] Claiming an existing withdrawal request for an existing on-chain account, where the lockup period has expired. Withdrawing funds involves + transferring ownership of a funded stake account to the specified "--withdrawer" public key. To withdraw, the authority signature of the bond + account is required, specified by the "--authority" parameter (default wallet). pause [options] [address] Pausing Validator Bond contract for config account resume [options] [address] Resuming Validator Bond contract for config account show-config [options] [address] Showing data of config account(s) show-event [options] Showing data of anchor event show-bond [options] [address] Showing data of bond account(s) show-settlement [options] [address] Showing data of settlement account(s) + bond-address [options]
From provided vote account address derives the bond account address help [command] display help for command ``` diff --git a/programs/validator-bonds/README.md b/programs/validator-bonds/README.md index 9adbf519..98aa85bf 100644 --- a/programs/validator-bonds/README.md +++ b/programs/validator-bonds/README.md @@ -45,8 +45,9 @@ the operator is required to merge all the `StakeAccounts` of the validator (delegated to the same `VoteAccount`) first and then fund such `StakeAccount` into `Settlement`. And the instruction is then capable to split `StakeAccount` with spill amount when needed. - - The creditor may claim the calculated amount from the `Settlement`. A deduplication - account, `SettlementClaim`, is created on-chain, referring to the fact that the protected event has already been claimed by the creditor. + - The creditor may claim the calculated amount from the `Settlement`. + From V2 there is created a bitmap structure on-chain named `SettlementClaims` that is created on-chain as a side-car to `Settlement` account. + When the protected event has already been claimed by the creditor the bitmap is updated to reflect the claim. - The `Settlement` may be claimed only for a limited number of epochs, which is configured by the admin authority in `Config`. After the elapsed time, the `Settlement` can be closed, and nothing more can be claimed. - When the claim time availability elapses, the `Settlement` account can be closed, and the account rent is withdrawn. diff --git a/settlement-pipelines/README.md b/settlement-pipelines/README.md index 73766f8f..70a426d8 100644 --- a/settlement-pipelines/README.md +++ b/settlement-pipelines/README.md @@ -24,9 +24,8 @@ There are 4 pipelines used for the binary commands. * [claim-settlements](../.buildkite/claim-settlements.yml): Claims settlements when possible. It is executed as a cron job once at a set interval. It checks the on-chain state to see if any settlements can be claimed. The settlement can be claimed within the time range of `Settlement Creation + non-claimable slots` to `Settlement Creation Epoch - Config claimable epoch`. -* [close-settlements](../.buildkite/close-settlements.yml): Closes `Settlement` accounts, `SettlementClaim` accounts, +* [close-settlements](../.buildkite/close-settlements.yml): Closes `Settlement` and `SettlementClaims` accounts, and resets the state of stake accounts to be associated back to the validator `Bond` when not claimed. - It verifies the on-chain state to see if the settlement has expired and if any `SettlementClaim` can be closed. * [verify-settlements](../.buildkite/verify-settlements.yml): Loading `Settlement` merkle tree data from gcloud and do if the on-chain state does not contain some unknown `Settlement` in comparison to gcloud list.