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

0.15.1 ci #1299

Merged
merged 25 commits into from
Apr 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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/v0.15.1/improvements/1278-opt_tx_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Disable Tendermint tx_index as default
([#1278](https://github.com/anoma/namada/issues/1278))
1 change: 1 addition & 0 deletions .changelog/v0.15.1/improvements/1297-tx-wasm-hash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Remove wasm code from tx ([#1297](https://github.com/anoma/namada/issues/1297))
2 changes: 2 additions & 0 deletions .changelog/v0.15.1/summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Namada 0.15.1 is a patch release addressing issues with high storage
usage due to duplicative storage of wasm code.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# CHANGELOG

## v0.15.1

Namada 0.15.1 is a patch release addressing issues with high storage
usage due to duplicative storage of wasm code.

### IMPROVEMENTS

- Disable Tendermint tx_index as default
([#1278](https://github.com/anoma/namada/issues/1278))
- Remove wasm code from tx ([#1297](https://github.com/anoma/namada/issues/1297))

## v0.15.0

Namada 0.15.0 is a regular minor release featuring various
Expand Down
22 changes: 11 additions & 11 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 apps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ license = "GPL-3.0"
name = "namada_apps"
readme = "../README.md"
resolver = "2"
version = "0.15.0"
version = "0.15.1"
default-run = "namada"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
3 changes: 2 additions & 1 deletion apps/src/bin/namada-node/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ pub fn main() -> Result<()> {
cmds::NamadaNode::Ledger(sub) => match sub {
cmds::Ledger::Run(cmds::LedgerRun(args)) => {
let wasm_dir = ctx.wasm_dir();
sleep_until(args.0);
sleep_until(args.start_time);
ctx.config.ledger.tendermint.tx_index = args.tx_index;
ledger::run(ctx.config.ledger, wasm_dir);
}
cmds::Ledger::RunUntil(cmds::LedgerRunUntil(args)) => {
Expand Down
24 changes: 20 additions & 4 deletions apps/src/lib/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,10 @@ pub mod cmds {
.or(rollback)
.or(run_until)
// The `run` command is the default if no sub-command given
.or(Some(Self::Run(LedgerRun(args::LedgerRun(None)))))
.or(Some(Self::Run(LedgerRun(args::LedgerRun {
start_time: None,
tx_index: false,
}))))
})
}

Expand Down Expand Up @@ -1732,6 +1735,7 @@ pub mod args {
const STORAGE_KEY: Arg<storage::Key> = arg("storage-key");
const SUB_PREFIX: ArgOpt<String> = arg_opt("sub-prefix");
const SUSPEND_ACTION: ArgFlag = flag("suspend");
const TENDERMINT_TX_INDEX: ArgFlag = flag("tx-index");
const TIMEOUT_HEIGHT: ArgOpt<u64> = arg_opt("timeout-height");
const TIMEOUT_SEC_OFFSET: ArgOpt<u64> = arg_opt("timeout-sec-offset");
const TOKEN_OPT: ArgOpt<WalletAddress> = TOKEN.opt();
Expand Down Expand Up @@ -1802,12 +1806,19 @@ pub mod args {
}

#[derive(Clone, Debug)]
pub struct LedgerRun(pub Option<DateTimeUtc>);
pub struct LedgerRun {
pub start_time: Option<DateTimeUtc>,
pub tx_index: bool,
}

impl Args for LedgerRun {
fn parse(matches: &ArgMatches) -> Self {
let time = NAMADA_START_TIME.parse(matches);
Self(time)
let start_time = NAMADA_START_TIME.parse(matches);
let tx_index = TENDERMINT_TX_INDEX.parse(matches);
Self {
start_time,
tx_index,
}
}

fn def(app: App) -> App {
Expand All @@ -1819,6 +1830,11 @@ pub mod args {
equivalent:\n2023-01-20T12:12:12Z\n2023-01-20 \
12:12:12Z\n2023- 01-20T12: 12:12Z",
))
.arg(
TENDERMINT_TX_INDEX
.def()
.about("Enable Tendermint tx indexing."),
)
}
}

Expand Down
25 changes: 25 additions & 0 deletions apps/src/lib/client/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1942,6 +1942,31 @@ pub async fn query_conversion(
))
}

/// Query a wasm code hash
pub async fn query_wasm_code_hash(
code_path: impl AsRef<str>,
ledger_address: TendermintAddress,
) -> Option<Hash> {
let client = HttpClient::new(ledger_address.clone()).unwrap();
let hash_key = Key::wasm_hash(code_path.as_ref());
match query_storage_value_bytes(&client, &hash_key, None, false)
.await
.0
{
Some(hash) => {
Some(Hash::try_from(&hash[..]).expect("Invalid code hash"))
}
None => {
eprintln!(
"The corresponding wasm code of the code path {} doesn't \
exist on chain.",
code_path.as_ref(),
);
None
}
}
}

/// Query a storage value and decode it with [`BorshDeserialize`].
pub async fn query_storage_value<T>(
client: &HttpClient,
Expand Down
Loading