Skip to content

Commit

Permalink
fix byte padding issue temp (#347)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leouarz authored Dec 21, 2023
1 parent d438abe commit ebfdac9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion node/src/chains/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use kate::config::{MAX_BLOCK_COLUMNS, MAX_BLOCK_ROWS};
use primitive_types::H160;
use sc_telemetry::TelemetryEndpoints;
use sp_core::sr25519::Public;
use sp_runtime::{AccountId32, Perbill};
use sp_runtime::AccountId32;

pub const PROTOCOL_ID: Option<&str> = Some("Avail");
pub const TELEMETRY_URL: &str = "ws://telemetry.avail.tools:8001/submit";
Expand Down
6 changes: 5 additions & 1 deletion pallets/system/src/extensions/check_weight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ where

// Check padded len.
let dynamic_block_len = DynamicBlockLength::<T>::get();
let padded_added_len = kate::padded_len(len as u32, dynamic_block_len.chunk_size());
// TODO: Make the calculation correct and not pessimistic (See kate::gridgen::EvaluationGrid::from_extrinsics for reference)
// We waste some space but we account that there might be, at maximum, 1 byte for padding tail delimiter, 2 bytes for every appId, 4 bytes for encoding the transaction
let padded_added_len =
kate::padded_len(len as u32, dynamic_block_len.chunk_size()).saturating_add(7u32);

all_extrinsics_len.padded = all_extrinsics_len.padded.saturating_add(padded_added_len);

let max_padded_len = BlockDimensions::new(
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
/// Per convention: if the runtime behavior changes, increment spec_version
/// and set impl_version to 0. This paramenter is typically incremented when
/// there's an update to the transaction_version.
spec_version: 15,
spec_version: 16,
/// The version of the implementation of the specification. Nodes can ignore this. It is only
/// used to indicate that the code is different. As long as the authoring_version and the
/// spec_version are the same, the code itself might have changed, but the native and Wasm
Expand Down

2 comments on commit ebfdac9

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: ebfdac9 Previous: 33f7951 Ratio
commitment_builder/32 4156486286 ns/iter (± 107137143) 4325417137 ns/iter (± 81695432) 0.96
commitment_builder/64 4070719238 ns/iter (± 48034938) 4343451680 ns/iter (± 92231152) 0.94
commitment_builder/128 4731118801 ns/iter (± 260094037) 4647446215 ns/iter (± 137494514) 1.02
commitment_builder/256 2223065102 ns/iter (± 110803343) 2367397557 ns/iter (± 42776582) 0.94

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: ebfdac9 Previous: 909af7f Ratio
commitment_builder_32 Instructions 43493867827 ops (± 0) 43503093041 ops (± 0) 1.00
commitment_builder_32 L1 Accesses 53525551860 ops (± 0) 53514815042 ops (± 0) 1.00
commitment_builder_32 L2 Accesses 724687 ops (± 0) 700403 ops (± 0) 1.03
commitment_builder_32 RAM Accesses 94257 ops (± 0) 89904 ops (± 0) 1.05
commitment_builder_32 Estimated Cycles 53532474290 ops (± 0) 53521463697 ops (± 0) 1.00
commitment_builder_64 Instructions 41963113321 ops (± 0) 41972869826 ops (± 0) 1.00
commitment_builder_64 L1 Accesses 51417672096 ops (± 0) 51407870438 ops (± 0) 1.00
commitment_builder_64 L2 Accesses 841453 ops (± 0) 893120 ops (± 0) 0.94
commitment_builder_64 RAM Accesses 193138 ops (± 0) 191298 ops (± 0) 1.01
commitment_builder_64 Estimated Cycles 51428639191 ops (± 0) 51419031468 ops (± 0) 1.00
commitment_builder_128 Instructions 54192348403 ops (± 0) 54204175550 ops (± 0) 1.00
commitment_builder_128 L1 Accesses 68310430412 ops (± 0) 68301951624 ops (± 0) 1.00
commitment_builder_128 L2 Accesses 1280231 ops (± 0) 1258510 ops (± 0) 1.02
commitment_builder_128 RAM Accesses 259012 ops (± 0) 242507 ops (± 0) 1.07
commitment_builder_128 Estimated Cycles 68325896987 ops (± 0) 68316731919 ops (± 0) 1.00
commitment_builder_256 Instructions 31752140329 ops (± 0) 31758548180 ops (± 0) 1.00
commitment_builder_256 L1 Accesses 40836135147 ops (± 0) 40833274463 ops (± 0) 1.00
commitment_builder_256 L2 Accesses 6783027 ops (± 0) 6788005 ops (± 0) 1.00
commitment_builder_256 RAM Accesses 248510 ops (± 0) 239352 ops (± 0) 1.04
commitment_builder_256 Estimated Cycles 40878748132 ops (± 0) 40875591808 ops (± 0) 1.00

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.