Skip to content

Commit 691f570

Browse files
authored
Merge branch 'main' into fix-cd
2 parents 8648792 + 7b9e53e commit 691f570

File tree

18 files changed

+290
-160
lines changed

18 files changed

+290
-160
lines changed

.github/workflows/cd.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ env:
1010
RUST_BACKTRACE: full
1111

1212
jobs:
13-
# The 3 following build jobs are 90% copy-pasted and should be refactored using
14-
# https://docs.github.com/en/actions/creating-actions/creating-a-composite-action
1513
release:
1614
strategy:
1715
matrix:
@@ -63,4 +61,4 @@ jobs:
6361
- name: Publish
6462
uses: softprops/action-gh-release@v1
6563
with:
66-
files: 'release_*'
64+
files: 'release_*'

.github/workflows/ci-light.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- uses: actions-rs/toolchain@v1
2222
with:
2323
profile: minimal
24-
toolchain: nightly
24+
toolchain: nightly-2021-12-03
2525
components: rustfmt
2626
override: true
2727
- uses: Swatinem/rust-cache@v1
@@ -41,7 +41,7 @@ jobs:
4141
- uses: actions-rs/toolchain@v1
4242
with:
4343
profile: minimal
44-
toolchain: nightly
44+
toolchain: nightly-2021-12-03
4545
override: true
4646
- uses: Swatinem/rust-cache@v1
4747
- uses: actions-rs/cargo@v1
@@ -60,7 +60,7 @@ jobs:
6060
- uses: actions-rs/toolchain@v1
6161
with:
6262
profile: minimal
63-
toolchain: nightly
63+
toolchain: nightly-2021-12-03
6464
components: clippy
6565
override: true
6666
- uses: Swatinem/rust-cache@v1

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- uses: actions-rs/toolchain@v1
2222
with:
2323
profile: minimal
24-
toolchain: nightly
24+
toolchain: nightly-2021-12-03
2525
components: rustfmt
2626
override: true
2727
- uses: Swatinem/rust-cache@v1
@@ -41,7 +41,7 @@ jobs:
4141
- uses: actions-rs/toolchain@v1
4242
with:
4343
profile: minimal
44-
toolchain: nightly
44+
toolchain: nightly-2021-12-03
4545
override: true
4646
- uses: Swatinem/rust-cache@v1
4747
- uses: actions-rs/cargo@v1
@@ -59,7 +59,7 @@ jobs:
5959
- uses: actions-rs/toolchain@v1
6060
with:
6161
profile: minimal
62-
toolchain: nightly
62+
toolchain: nightly-2021-12-03
6363
override: true
6464
- uses: Swatinem/rust-cache@v1
6565
- uses: actions-rs/cargo@v1
@@ -78,7 +78,7 @@ jobs:
7878
- uses: actions-rs/toolchain@v1
7979
with:
8080
profile: minimal
81-
toolchain: nightly
81+
toolchain: nightly-2021-12-03
8282
override: true
8383
- uses: Swatinem/rust-cache@v1
8484
- uses: actions-rs/cargo@v1
@@ -98,7 +98,7 @@ jobs:
9898
- uses: actions-rs/toolchain@v1
9999
with:
100100
profile: minimal
101-
toolchain: nightly
101+
toolchain: nightly-2021-12-03
102102
components: clippy
103103
override: true
104104
- uses: Swatinem/rust-cache@v1
@@ -126,7 +126,7 @@ jobs:
126126
- uses: actions-rs/toolchain@v1
127127
with:
128128
profile: minimal
129-
toolchain: nightly
129+
toolchain: nightly-2021-12-03
130130
override: true
131131
- uses: Swatinem/rust-cache@v1
132132
- uses: actions-rs/cargo@v1
@@ -151,7 +151,7 @@ jobs:
151151
- uses: actions-rs/toolchain@v1
152152
with:
153153
profile: minimal
154-
toolchain: nightly
154+
toolchain: nightly-2021-12-03
155155
override: true
156156
- uses: actions-rs/cargo@v1
157157
with:
@@ -184,7 +184,7 @@ jobs:
184184
- uses: actions-rs/toolchain@v1
185185
with:
186186
profile: minimal
187-
toolchain: nightly
187+
toolchain: nightly-2021-12-03
188188
components: rustfmt
189189
override: true
190190
- uses: actions-rs/cargo@v1

.github/workflows/stale.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
2+
#
3+
# You can adjust the behavior by modifying this file.
4+
# For more information, see:
5+
# https://github.com/actions/stale
6+
name: Mark stale issues and pull requests
7+
8+
on:
9+
schedule:
10+
- cron: '22 18 * * *'
11+
12+
jobs:
13+
stale:
14+
15+
runs-on: ubuntu-latest
16+
permissions:
17+
issues: write
18+
pull-requests: write
19+
20+
steps:
21+
- uses: actions/stale@v3
22+
with:
23+
repo-token: ${{ secrets.GITHUB_TOKEN }}
24+
stale-issue-message: 'Stale issue message'
25+
stale-pr-message: 'Stale pull request message'
26+
stale-issue-label: 'no-issue-activity'
27+
stale-pr-label: 'no-pr-activity'

massa-client/src/cmds.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -612,14 +612,18 @@ impl Command {
612612
}
613613
Command::when_episode_ends => {
614614
let end = match client.public.get_status().await {
615-
Ok(node_status) => node_status.consensus_stats.end_timespan,
615+
Ok(node_status) => node_status.config.end_timestamp,
616616
Err(e) => bail!("RpcError: {}", e),
617617
};
618-
let (days, hours, mins, secs) = end
619-
.saturating_sub(MassaTime::now()?)
620-
.days_hours_mins_secs()?; // compensation millis is zero
621618
let mut res = "".to_string();
622-
res.push_str(&format!("{} days, {} hours, {} minutes, {} seconds remaining until the end of the current episode", days, hours, mins, secs));
619+
if let Some(e) = end {
620+
let (days, hours, mins, secs) =
621+
e.saturating_sub(MassaTime::now()?).days_hours_mins_secs()?; // compensation millis is zero
622+
623+
res.push_str(&format!("{} days, {} hours, {} minutes, {} seconds remaining until the end of the current episode", days, hours, mins, secs));
624+
} else {
625+
res.push_str("There is no end !")
626+
}
623627
if !json {
624628
println!("{}", res);
625629
}

massa-consensus/endorsements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Goal
44

5-
Endorsements are included in a block's header. They are created by randomly selected endorsers chosen amon the stakers (including the block creator) to endorse the block's parent in the same thread. The block's total fee and reward are split between the block creator, the endorsers, and the creator of the endorsed block.
5+
Endorsements are included in a block's header. They are created by randomly selected endorsers chosen among the stakers (including the block creator) to endorse the block's parent in the same thread. The block's total fee and reward are split between the block creator, the endorsers, and the creator of the endorsed block.
66

77
With that mechanism it becomes harder to gain control of the network (you now have to control `endorsement_count + 1` draw to gain control over one block) and to reward stakers more frequently.
88

massa-consensus/src/block_graph.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,35 +51,35 @@ impl HeaderOrBlock {
5151
}
5252
}
5353

54-
/// Agregated changes made during a block's execution
54+
/// Aggregated changes made during a block's execution
5555
#[derive(Debug, Clone)]
5656
pub struct BlockStateAccumulator {
5757
/// Addresses impacted by ledger updates
5858
pub loaded_ledger_addrs: AddressHashSet,
5959
/// Subset of the ledger. Contains only data in the thread of the given block
6060
pub ledger_thread_subset: LedgerSubset,
61-
/// Cummulative changes made during that block execution
61+
/// Cumulative changes made during that block execution
6262
pub ledger_changes: LedgerChanges,
6363
/// Addresses impacted by roll updates
6464
pub loaded_roll_addrs: AddressHashSet,
6565
/// Current roll counts for these addresses
6666
pub roll_counts: RollCounts,
6767
/// Roll updates that happened during that block execution
6868
pub roll_updates: RollUpdates,
69-
/// Roll updates that happend during current cycle
69+
/// Roll updates that happened during current cycle
7070
pub cycle_roll_updates: RollUpdates,
7171
/// Cycle of the parent in the same thread
7272
pub same_thread_parent_cycle: u64,
7373
/// Address of the parent in the same thread
7474
pub same_thread_parent_creator: Address,
75-
/// Adresses of that block endorsers
75+
/// Addresses of that block endorsers
7676
pub endorsers_addresses: Vec<Address>,
7777
}
7878

7979
/// Block that was checked as final, with some useful precomputed data
8080
#[derive(Debug, Clone, Serialize, Deserialize)]
8181
pub struct ActiveBlock {
82-
/// The cretor's address
82+
/// The creator's address
8383
pub creator_address: Address,
8484
/// The block itself, as it was created
8585
pub block: Block,
@@ -92,7 +92,7 @@ pub struct ActiveBlock {
9292
pub dependencies: BlockHashSet,
9393
/// Blocks id that have this block as an ancestor
9494
pub descendants: BlockHashSet,
95-
/// ie has its fitness reached the given thresold
95+
/// ie has its fitness reached the given threshold
9696
pub is_final: bool,
9797
/// Changes caused by this block
9898
pub block_ledger_changes: LedgerChanges,
@@ -118,7 +118,7 @@ impl ActiveBlock {
118118
}
119119

120120
/// Exportable version of ActiveBlock
121-
/// Fields that can be easily recomuted were left out
121+
/// Fields that can be easily recomputed were left out
122122
#[derive(Debug, Clone, Serialize, Deserialize)]
123123
pub struct ExportActiveBlock {
124124
/// The block itself, as it was created
@@ -130,7 +130,7 @@ pub struct ExportActiveBlock {
130130
pub children: Vec<BlockHashMap<u64>>,
131131
/// dependencies required for validity check
132132
pub dependencies: BlockHashSet,
133-
/// ie has its fitness reached the given thresold
133+
/// ie has its fitness reached the given threshold
134134
pub is_final: bool,
135135
/// Changes caused by this block
136136
pub block_ledger_changes: LedgerChanges,
@@ -1195,7 +1195,7 @@ impl BlockGraph {
11951195
})
11961196
}
11971197

1198-
/// Try to apply an operation in the contexxt of the block
1198+
/// Try to apply an operation in the context of the block
11991199
///
12001200
/// # Arguments
12011201
/// * state_accu: where the changes are accumulated while we go through the block
@@ -1566,7 +1566,7 @@ impl BlockGraph {
15661566
Ok(accu)
15671567
}
15681568

1569-
/// Gets lastest final blocks (hash, period) for each thread.
1569+
/// Gets latest final blocks (hash, period) for each thread.
15701570
pub fn get_latest_final_blocks_periods(&self) -> &Vec<(BlockId, u64)> {
15711571
&self.latest_final_blocks_periods
15721572
}
@@ -1736,7 +1736,7 @@ impl BlockGraph {
17361736
Ok((cur_rolls, cur_cycle_roll_updates))
17371737
}
17381738

1739-
/// gets Ledger data export for given Addressses
1739+
/// gets Ledger data export for given Addressees
17401740
pub fn get_ledger_data_export(
17411741
&self,
17421742
addresses: &AddressHashSet,

massa-consensus/src/consensus_worker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,7 @@ impl ConsensusWorker {
12021202
self.block_db.get_operations(operation_ids)
12031203
}
12041204

1205-
/// Manages received protocolevents.
1205+
/// Manages received protocol events.
12061206
///
12071207
/// # Arguments
12081208
/// * event: event type to process.

massa-consensus/src/tests/scenario_roll.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,7 @@ async fn test_roll() {
476476
.await;
477477
}
478478

479+
#[ignore]
479480
#[tokio::test]
480481
#[serial]
481482
async fn test_roll_block_creation() {

0 commit comments

Comments
 (0)