Skip to content

Commit

Permalink
Merge tag 'v0.18.1' into tiago/ethbridge/amounts+ethbridge
Browse files Browse the repository at this point in the history
Namada 0.18.1 is a patch release that addresses transaction format changes and minor ledger storage improvements.

* tag 'v0.18.1':
  Namada 0.18.1
  added chagelog
  Added changelog entry.
  clippy, fmt
  Simplified the reveal PK transaction construction flow. Factored chain_id reading from submit functions.
  Allow Tx builders to take verification keys.
  Increased usage of PublicKeys relative to SecretKeys in tx construction.
  Only reveal a public key when the signer is an implicit address.
  Now only use TxBroadcastData::Wrapper for non dry runs.
  Now update proof of work solution in transaction header.
  Separating out the reveal PK transaction construction.
  Separate transaction building from signing from submission.
  Removed unnecessary header updates for dry runs.
  clippy
  fmt and clippy
  Update .github/PULL_REQUEST_TEMPLATE/new_topic.md
  hopefully fixes init_network
  Added a changelog entry.
  Stop encrypting transactions in tests.
  Disable encrypting transactions when sending.
  git: added topic PR template
  fix: increase the genesis parameter
  changelog: add #1632
  storage_api/lazy_map: remove entries by prefixed key
  test/core/wl_storage: extend prefix iter test to include delete prefix
  core/storage_api: add `StorageWrite::delete_prefix`
  changelog: add #1642
  test/storage/rocksdb: check that prefix_iter matches only full segments
  ledger/db: ensure that prefix iter only matches full key segments
  fix `unclog release` command
  Added changelog entry.
  Fixed processing of code inside init-proposal transactions.
  changelog: add #1642
  test/storage/rocksdb: check that prefix_iter matches only full segments
  Update build_network.sh
  Added changelog entry.
  [fix]: CMT_LOG_LEVEL is now correct, not TM_LOG_LEVEL
  ledger/db: ensure that prefix iter only matches full key segments
  fix annoying error on line 69
  [fix]: Fix failing test-wasm by adding code section and also signing over that.
  docs: update rust-analyzer clippy override
  Expanded validate_header to check for signature over all sections, and renamed it to validate_tx.
  Make the signature section unmalleable.
  VPs now check that code and data are signed together.
  Fixed clippy and formatting issues.
  Fixed the tests involving transaction signing.
  Now sign over all sections in transactions.
  Added CLI subcommand for validator change commission. Cleared up the MASP source and target in test vector expert view.
  Now moving proposal code into extra section.
  Increased the number of init-proposal and vote-proposal test vectors. Moved init-proposal content into extra data.
  • Loading branch information
brentstone committed Jul 6, 2023
2 parents c6712da + fe693cb commit 4fd790b
Show file tree
Hide file tree
Showing 77 changed files with 1,990 additions and 1,478 deletions.
2 changes: 2 additions & 0 deletions .changelog/v0.18.1/bug-fixes/1607-fix-tx-malleability.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Fixed bug that allowed transactions to be modified without invalidating
transaction hash ([\#1607](https://github.com/anoma/namada/pull/1607))
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Move the content and code of init proposal transactions
into separare section to reduce tx size for hardware wallets
([\#1611](https://github.com/anoma/namada/pull/1611))
2 changes: 2 additions & 0 deletions .changelog/v0.18.1/features/1632-delete-prefix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Storage: Add a function to delete key-vals matching a given prefix.
([\#1632](https://github.com/anoma/namada/pull/1632))
3 changes: 3 additions & 0 deletions .changelog/v0.18.1/improvements/1498-separate-signing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Separate the transaction building, signing, and submission
actions in the SDKs API to enable hardware wallet usage
([\#1498](https://github.com/anoma/namada/pull/1498))
2 changes: 2 additions & 0 deletions .changelog/v0.18.1/improvements/1636-disable-encryption.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Disable encryption when sending transactions
([\#1636](https://github.com/anoma/namada/pull/1636))
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Storage: Ensure that prefix iterator only returns key-
vals in which the prefix key segments are matched fully.
([\#1642](https://github.com/anoma/namada/pull/1642))
1 change: 1 addition & 0 deletions .changelog/v0.18.1/summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Namada 0.18.1 is a patch release that addresses transaction format changes and minor ledger storage improvements.
10 changes: 10 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/new_topic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Describe your changes

## Indicate on which other PRs this topic is based on, if any

## Checklist before merging to `draft`
- [ ] I have checked that the following e2e test are working locally
- `masp_incentives`
- `masp_txs_and_queries`
- `proposal_submission`
- [ ] I have added a changelog
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# CHANGELOG

## v0.18.1

Namada 0.18.1 is a patch release that addresses transaction format changes and minor ledger storage improvements.

### BUG FIXES

- Fixed bug that allowed transactions to be modified without invalidating
transaction hash ([\#1607](https://github.com/anoma/namada/pull/1607))
- Move the content and code of init proposal transactions
into separare section to reduce tx size for hardware wallets
([\#1611](https://github.com/anoma/namada/pull/1611))

### FEATURES

- Storage: Add a function to delete key-vals matching a given prefix.
([\#1632](https://github.com/anoma/namada/pull/1632))

### IMPROVEMENTS

- Separate the transaction building, signing, and submission
actions in the SDKs API to enable hardware wallet usage
([\#1498](https://github.com/anoma/namada/pull/1498))
- Disable encryption when sending transactions
([\#1636](https://github.com/anoma/namada/pull/1636))
- Storage: Ensure that prefix iterator only returns key-
vals in which the prefix key segments are matched fully.
([\#1642](https://github.com/anoma/namada/pull/1642))

## v0.18.0

Namada 0.18.0 is a minor release primarily addressing a major change in the token amount representation, the addition of a new validator set category, and other minor improvements to the ledger stability.
Expand Down
24 changes: 12 additions & 12 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ keywords = ["blockchain", "privacy", "crypto", "protocol", "network"]
license = "GPL-3.0"
readme = "README.md"
repository = "https://github.com/anoma/namada"
version = "0.18.0"
version = "0.18.1"

[workspace.dependencies]
ark-bls12-381 = {version = "0.3"}
Expand Down
13 changes: 12 additions & 1 deletion apps/src/bin/namada-client/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ pub async fn main() -> Result<()> {
.proceed_or_else(error)?;
let args = args.to_sdk(&mut ctx);
tx::submit_init_validator::<HttpClient>(&client, ctx, args)
.await;
.await?;
}
Sub::TxInitProposal(TxInitProposal(mut args)) => {
let client = HttpClient::new(utils::take_config_address(
Expand Down Expand Up @@ -186,6 +186,17 @@ pub async fn main() -> Result<()> {
tx::submit_withdraw::<HttpClient>(&client, ctx, args)
.await?;
}
Sub::TxCommissionRateChange(TxCommissionRateChange(args)) => {
wait_until_node_is_synched(&args.tx.ledger_address).await;
let client =
HttpClient::new(args.tx.ledger_address.clone())
.unwrap();
let args = args.to_sdk(&mut ctx);
tx::submit_validator_commission_change::<HttpClient>(
&client, ctx, args,
)
.await?;
}
// Eth bridge
Sub::AddToEthBridgePool(args) => {
let mut args = args.0;
Expand Down
67 changes: 60 additions & 7 deletions apps/src/lib/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ pub mod cmds {
.subcommand(Bond::def().display_order(2))
.subcommand(Unbond::def().display_order(2))
.subcommand(Withdraw::def().display_order(2))
.subcommand(TxCommissionRateChange::def().display_order(2))
// Ethereum bridge
.subcommand(AddToEthBridgePool::def().display_order(3))
// Queries
Expand Down Expand Up @@ -255,6 +256,8 @@ pub mod cmds {
Self::parse_with_ctx(matches, TxInitProposal);
let tx_vote_proposal =
Self::parse_with_ctx(matches, TxVoteProposal);
let tx_commission_rate_change =
Self::parse_with_ctx(matches, TxCommissionRateChange);
let bond = Self::parse_with_ctx(matches, Bond);
let unbond = Self::parse_with_ctx(matches, Unbond);
let withdraw = Self::parse_with_ctx(matches, Withdraw);
Expand Down Expand Up @@ -291,6 +294,7 @@ pub mod cmds {
.or(tx_init_proposal)
.or(tx_vote_proposal)
.or(tx_init_validator)
.or(tx_commission_rate_change)
.or(bond)
.or(unbond)
.or(withdraw)
Expand Down Expand Up @@ -354,6 +358,7 @@ pub mod cmds {
TxUpdateVp(TxUpdateVp),
TxInitAccount(TxInitAccount),
TxInitValidator(TxInitValidator),
TxCommissionRateChange(TxCommissionRateChange),
TxInitProposal(TxInitProposal),
TxVoteProposal(TxVoteProposal),
TxRevealPk(TxRevealPk),
Expand Down Expand Up @@ -1595,6 +1600,32 @@ pub mod cmds {
}
}

#[derive(Clone, Debug)]
pub struct TxCommissionRateChange(
pub args::CommissionRateChange<args::CliTypes>,
);

impl SubCmd for TxCommissionRateChange {
const CMD: &'static str = "change-commission-rate";

fn parse(matches: &ArgMatches) -> Option<Self>
where
Self: Sized,
{
matches.subcommand_matches(Self::CMD).map(|matches| {
TxCommissionRateChange(args::CommissionRateChange::parse(
matches,
))
})
}

fn def() -> App {
App::new(Self::CMD)
.about("Change commission raate.")
.add_args::<args::CommissionRateChange<args::CliTypes>>()
}
}

#[derive(Clone, Debug)]
pub struct TxVoteProposal(pub args::VoteProposal<args::CliTypes>);

Expand Down Expand Up @@ -2376,6 +2407,8 @@ pub mod args {
pub const VALIDATOR_ETH_HOT_KEY: ArgOpt<WalletKeypair> =
arg_opt("eth-hot-key");
pub const VALUE: ArgOpt<String> = arg_opt("value");
pub const VERIFICATION_KEY: ArgOpt<WalletPublicKey> =
arg_opt("verification-key");
pub const VIEWING_KEY: Arg<WalletViewingKey> = arg("key");
pub const WALLET_ALIAS_FORCE: ArgFlag = flag("wallet-alias-force");
pub const WASM_CHECKSUMS_PATH: Arg<PathBuf> = arg("wasm-checksums-path");
Expand Down Expand Up @@ -3989,11 +4022,11 @@ pub mod args {
}
}

impl CliToSdk<TxCommissionRateChange<SdkTypes>>
for TxCommissionRateChange<CliTypes>
impl CliToSdk<CommissionRateChange<SdkTypes>>
for CommissionRateChange<CliTypes>
{
fn to_sdk(self, ctx: &mut Context) -> TxCommissionRateChange<SdkTypes> {
TxCommissionRateChange::<SdkTypes> {
fn to_sdk(self, ctx: &mut Context) -> CommissionRateChange<SdkTypes> {
CommissionRateChange::<SdkTypes> {
tx: self.tx.to_sdk(ctx),
validator: ctx.get(&self.validator),
rate: self.rate,
Expand All @@ -4002,7 +4035,7 @@ pub mod args {
}
}

impl Args for TxCommissionRateChange<CliTypes> {
impl Args for CommissionRateChange<CliTypes> {
fn parse(matches: &ArgMatches) -> Self {
let tx = Tx::parse(matches);
let validator = VALIDATOR.parse(matches);
Expand Down Expand Up @@ -4229,11 +4262,16 @@ pub mod args {
fee_token: ctx.get(&self.fee_token),
gas_limit: self.gas_limit,
signing_key: self.signing_key.map(|x| ctx.get_cached(&x)),
verification_key: self
.verification_key
.map(|x| ctx.get_cached(&x)),
signer: self.signer.map(|x| ctx.get(&x)),
tx_reveal_code_path: self.tx_reveal_code_path,
password: self.password,
expiration: self.expiration,
chain_id: self.chain_id,
chain_id: self
.chain_id
.or_else(|| Some(ctx.config.ledger.chain_id.clone())),
}
}
}
Expand Down Expand Up @@ -4292,7 +4330,8 @@ pub mod args {
public key, public key hash or alias from your \
wallet.",
)
.conflicts_with(SIGNER.name),
.conflicts_with(SIGNER.name)
.conflicts_with(VERIFICATION_KEY.name),
)
.arg(
SIGNER
Expand All @@ -4301,6 +4340,18 @@ pub mod args {
"Sign the transaction with the keypair of the public \
key of the given address.",
)
.conflicts_with(SIGNING_KEY_OPT.name)
.conflicts_with(VERIFICATION_KEY.name),
)
.arg(
VERIFICATION_KEY
.def()
.help(
"Sign the transaction with the key for the given \
public key, public key hash or alias from your \
wallet.",
)
.conflicts_with(SIGNER.name)
.conflicts_with(SIGNING_KEY_OPT.name),
)
.arg(CHAIN_ID_OPT.def().help("The chain ID."))
Expand All @@ -4320,6 +4371,7 @@ pub mod args {
let gas_limit = GAS_LIMIT.parse(matches).amount.into();
let expiration = EXPIRATION_OPT.parse(matches);
let signing_key = SIGNING_KEY_OPT.parse(matches);
let verification_key = VERIFICATION_KEY.parse(matches);
let signer = SIGNER.parse(matches);
let tx_reveal_code_path = PathBuf::from(TX_REVEAL_PK);
let chain_id = CHAIN_ID_OPT.parse(matches);
Expand All @@ -4337,6 +4389,7 @@ pub mod args {
gas_limit,
expiration,
signing_key,
verification_key,
signer,
tx_reveal_code_path,
password,
Expand Down
Loading

0 comments on commit 4fd790b

Please sign in to comment.