Skip to content

Commit

Permalink
Fix clap args defaults and update the changelog
Browse files Browse the repository at this point in the history
* Updated to use `default_value_t` instead of `default_value` with additional parser
* Added `CHUNK_SIZE_IN_BYTES` change info in the change log
  • Loading branch information
0xjunha committed Nov 29, 2024
1 parent 3c75b48 commit e86476d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ impl LargePackageTestContext {
publish_type,
Some(self.object_address),
AccountAddress::from_str(LARGE_PACKAGES_MODULE_ADDRESS).unwrap(),
CHUNK_SIZE_IN_BYTES.parse().unwrap(),
CHUNK_SIZE_IN_BYTES,
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion aptos-move/framework/src/chunked_publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub const LARGE_PACKAGES_MODULE_ADDRESS: &str =
"0x0e1ca3011bdd07246d4d16d909dbb2d6953a86c4735d5acf5865d962c630cce7";

/// The default chunk size for splitting code and metadata to fit within the transaction size limits.
pub const CHUNK_SIZE_IN_BYTES: &str = "55000";
pub const CHUNK_SIZE_IN_BYTES: usize = 55_000;

pub enum PublishType {
AccountDeploy,
Expand Down
1 change: 1 addition & 0 deletions crates/aptos/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All notable changes to the Aptos CLI will be captured in this file. This project

- Add `--node-api-key` flag to `aptos move replay` to allow for querying the fullnode with an API key.
- Add `--chunk-size` flag to allow configuring chunk size for chunked publish mode.
- Update the default chunk size for chunked publish mode (`CHUNK_SIZE_IN_BYTES`) from 60,000 to 55,000.

## [4.5.0] - 2024/11/15
- Determine network from URL to make explorer links better for legacy users
Expand Down
2 changes: 1 addition & 1 deletion crates/aptos/src/common/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2380,6 +2380,6 @@ pub struct ChunkedPublishOption {
/// By default, the chunk size is set to `CHUNK_SIZE_IN_BYTES`. A smaller chunk size will result
/// in more transactions required to publish a package, while a larger chunk size might cause
/// transaction to fail due to exceeding the execution gas limit.
#[clap(long, default_value = CHUNK_SIZE_IN_BYTES, value_parser = clap::value_parser!(usize))]
#[clap(long, default_value_t = CHUNK_SIZE_IN_BYTES)]
pub(crate) chunk_size: usize,
}
2 changes: 1 addition & 1 deletion crates/aptos/src/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ impl CliTestFramework {
LARGE_PACKAGES_MODULE_ADDRESS,
)
.unwrap(),
chunk_size: CHUNK_SIZE_IN_BYTES.parse().unwrap(),
chunk_size: CHUNK_SIZE_IN_BYTES,
},
}
.execute()
Expand Down

0 comments on commit e86476d

Please sign in to comment.