Skip to content
Open
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
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.

5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ Prerequisites:
* Grab `zombienet` utility used to start network from [releases](https://github.com/paritytech/zombienet/releases)


```
```bash
cd ./launch-configs/zombienet
zombienet spawn local.json

// Enable 2s blocktime
node scripts/assign_cores.js
```

### Interaction with the node
Expand Down
6 changes: 5 additions & 1 deletion launch-configs/zombienet/local.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
"patch": {
"configuration": {
"config": {
"scheduler_params": {
"num_cores": 3
},
"async_backing_params": {
"max_candidate_depth": 3,
"max_candidate_depth": 6,
"allowed_ancestry_len": 2
}
}
Expand All @@ -28,6 +31,7 @@
{
"name": "alice",
"ws_port": 9944,
"rpc_port": 9945,
"validator": true
},
{
Expand Down
2 changes: 1 addition & 1 deletion node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ fn start_consensus(
para_id,
proposer,
collator_service,
authoring_duration: Duration::from_millis(1500),
authoring_duration: Duration::from_millis(2000),
reinitialize: false,
slot_offset: Duration::from_secs(1),
block_import_handle,
Expand Down
2 changes: 1 addition & 1 deletion primitives/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "primitives"
version = "6.7.0"
version = "6.7.1"
authors = ["GalacticCouncil"]
edition = "2021"
repository = "https://github.com/galacticcouncil/Basilisk-node"
Expand Down
20 changes: 12 additions & 8 deletions primitives/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,12 @@ pub mod time {
/// up by `pallet_aura` to implement `fn slot_duration()`.
///
/// Change this to adjust the block time.
pub const MILLISECS_PER_BLOCK: u64 = 6000;
pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;
pub const MILLISECS_PER_BLOCK: u64 = 2000;

// The slot duration determines the length of each author's turn and is decoupled from the block
// production interval. During their slot, authors are allowed to produce multiple blocks. **The
// slot duration is required to be at least 6s (same as on the relay chain).**
pub const SLOT_DURATION: u64 = 6000;

// Time is measured by number of blocks.
pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);
Expand Down Expand Up @@ -75,9 +79,9 @@ pub mod chain {
/// Minimum pool liquidity
pub const MIN_POOL_LIQUIDITY: Balance = 1000;

/// We allow for 2 seconds of compute with a 6 second average block.
/// We allow for 1.5 seconds of compute with a 2 second average block.
pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(
WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2),
WEIGHT_REF_TIME_PER_SECOND.saturating_mul(3).saturating_div(2),
polkadot_primitives::v8::MAX_POV_SIZE as u64,
);

Expand All @@ -96,10 +100,10 @@ mod tests {
assert_eq!(DAYS / 24, HOURS);
// 60 minuts in an hour
assert_eq!(HOURS / 60, MINUTES);
// 1 minute = 60s = 10 blocks 6s each
assert_eq!(MINUTES, 10);
// 6s per block
assert_eq!(SECS_PER_BLOCK, 6);
// 1 minute = 60s = 10 blocks 2s each
assert_eq!(MINUTES, 30);
// 2s per block
assert_eq!(SECS_PER_BLOCK, 2);
// 1s = 1000ms
assert_eq!(MILLISECS_PER_BLOCK / 1000, SECS_PER_BLOCK);
// Extra check for epoch time because changing it bricks the block production and requires regenesis
Expand Down
2 changes: 1 addition & 1 deletion runtime/basilisk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "basilisk-runtime"
version = "132.0.0"
version = "133.0.0"
authors = ["GalacticCouncil"]
edition = "2021"
homepage = "https://github.com/galacticcouncil/Basilisk-node"
Expand Down
2 changes: 1 addition & 1 deletion runtime/basilisk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: Cow::Borrowed("basilisk"),
impl_name: Cow::Borrowed("basilisk"),
authoring_version: 1,
spec_version: 132,
spec_version: 133,
impl_version: 0,
apis: apis::RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down
6 changes: 3 additions & 3 deletions runtime/basilisk/src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
pub const DEFAULT_RELAY_PARENT_OFFSET: u32 = 1;
/// How many parachain blocks are processed by the relay chain per parent. Limits the number of
/// blocks authored per slot.
pub const BLOCK_PROCESSING_VELOCITY: u32 = 1;
pub const BLOCK_PROCESSING_VELOCITY: u32 = 3;
/// Maximum number of blocks simultaneously accepted by the Runtime, not yet included into the
/// relay chain.
pub const UNINCLUDED_SEGMENT_CAPACITY: u32 = (3 + DEFAULT_RELAY_PARENT_OFFSET) * BLOCK_PROCESSING_VELOCITY;
Expand Down Expand Up @@ -242,7 +242,7 @@ impl pallet_timestamp::Config for Runtime {
/// A timestamp: milliseconds since the unix epoch.
type Moment = u64;
type OnTimestampSet = ();
type MinimumPeriod = ConstU64<{ SLOT_DURATION / 2 }>;
type MinimumPeriod = ConstU64<0>;
type WeightInfo = weights::pallet_timestamp::BasiliskWeight<Runtime>;
}

Expand Down Expand Up @@ -611,7 +611,7 @@ impl pallet_transaction_pause::Config for Runtime {
}

parameter_types! {
pub const RewardPerCollator: Balance = 15_240_000_000_000_000; // 6.35[BSX/block] * 2400[block]
pub const RewardPerCollator: Balance = 15_240_000_000_000_000; // fixed reward per session
//GalacticCouncil collators
pub ExcludedCollators: Vec<AccountId> = vec![
// bXn5CfJB2qHvqnuMqTpXn6un9Fjch8mwkb9i3JUsGVD4ChLoe
Expand Down
Loading
Loading