Skip to content

Commit

Permalink
Pre Mainnnet (#4557)
Browse files Browse the repository at this point in the history
* Update ci.yml

* Feature/feature/versioning ser der harden 2 (#4554)

* Add some unit tests for versioning deserialization to the limits

* Clippy pass

* Better error message

* Minor fixes

* Excluded -> Included

---------

Co-authored-by: sydhds <[email protected]>

* Add versioninig key & value checks (#4552)

* Add versioninig key & value checks

* Improve error message when no prefix

---------

Co-authored-by: sydhds <[email protected]>

* Update CI, Version and genesis timestamp

---------

Co-authored-by: Sydhds <[email protected]>
Co-authored-by: sydhds <[email protected]>
  • Loading branch information
3 people authored Nov 27, 2023
1 parent 8b1e610 commit 1f32b9d
Show file tree
Hide file tree
Showing 46 changed files with 293 additions and 97 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [main, staging, trying]
pull_request:
branches: [main, 'testnet_*', 'buildnet_wip']
branches: [main, 'testnet_*']
types:
- opened
- reopened
Expand Down
2 changes: 1 addition & 1 deletion massa-api-exports/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_api_exports"
version = "0.27.0"
version = "0.27.1"
authors = ["Massa Labs <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion massa-api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_api"
version = "0.27.0"
version = "0.27.1"
edition = "2021"

[features]
Expand Down
2 changes: 1 addition & 1 deletion massa-async-pool/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_async_pool"
version = "0.27.0"
version = "0.27.1"
authors = ["Massa Labs <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion massa-bootstrap/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_bootstrap"
version = "0.27.0"
version = "0.27.1"
authors = ["Massa Labs <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion massa-channel/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_channel"
version = "0.27.0"
version = "0.27.1"
edition = "2021"

[features]
Expand Down
2 changes: 1 addition & 1 deletion massa-cipher/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_cipher"
version = "0.27.0"
version = "0.27.1"
edition = "2021"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion massa-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa-client"
version = "0.27.0"
version = "0.27.1"
edition = "2021"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion massa-consensus-exports/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_consensus_exports"
version = "0.27.0"
version = "0.27.1"
authors = ["Massa Labs <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion massa-consensus-worker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_consensus_worker"
version = "0.27.0"
version = "0.27.1"
authors = ["Massa Labs <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion massa-db-exports/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_db_exports"
version = "0.27.0"
version = "0.27.1"
edition = "2021"

[features]
Expand Down
2 changes: 1 addition & 1 deletion massa-db-worker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_db_worker"
version = "0.27.0"
version = "0.27.1"
edition = "2021"

[features]
Expand Down
2 changes: 1 addition & 1 deletion massa-executed-ops/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_executed_ops"
version = "0.27.0"
version = "0.27.1"
authors = ["Massa Labs <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion massa-execution-exports/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_execution_exports"
version = "0.27.0"
version = "0.27.1"
authors = ["Massa Labs <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion massa-execution-worker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ harness = false

[package]
name = "massa_execution_worker"
version = "0.27.0"
version = "0.27.1"
authors = ["Massa Labs <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion massa-factory-exports/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_factory_exports"
version = "0.27.0"
version = "0.27.1"
authors = ["Massa Labs <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion massa-factory-worker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_factory_worker"
version = "0.27.0"
version = "0.27.1"
authors = ["Massa Labs <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion massa-final-state/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_final_state"
version = "0.27.0"
version = "0.27.1"
authors = ["Massa Labs <[email protected]>"]
edition = "2021"

Expand Down
47 changes: 43 additions & 4 deletions massa-final-state/src/final_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ use crate::{config::FinalStateConfig, error::FinalStateError, state_changes::Sta

use anyhow::{anyhow, Result as AnyResult};
use massa_async_pool::AsyncPool;
use massa_db_exports::EXECUTION_TRAIL_HASH_PREFIX;
use massa_db_exports::{
DBBatch, MassaIteratorMode, ShareableMassaDBController, ASYNC_POOL_PREFIX,
CYCLE_HISTORY_PREFIX, DEFERRED_CREDITS_PREFIX, EXECUTED_DENUNCIATIONS_PREFIX,
EXECUTED_OPS_PREFIX, LEDGER_PREFIX, MIP_STORE_PREFIX, STATE_CF,
};
use massa_db_exports::{EXECUTION_TRAIL_HASH_PREFIX, MIP_STORE_STATS_PREFIX, VERSIONING_CF};
use massa_executed_ops::ExecutedDenunciations;
use massa_executed_ops::ExecutedOps;
use massa_hash::Hash;
Expand Down Expand Up @@ -635,16 +635,55 @@ impl FinalState {
));
}
} else if serialized_key.starts_with(MIP_STORE_PREFIX.as_bytes()) {
// TODO: check MIP_STORE_PREFIX
if !self
.mip_store
.is_key_value_valid(&serialized_key, &serialized_value)
{
warn!("Wrong key/value for MIP Store");
return Err(anyhow!(
"Wrong key/value for MIP Store serialized_key: {:?}, serialized_value: {:?}",
serialized_key, serialized_value
));
}
} else if serialized_key.starts_with(EXECUTION_TRAIL_HASH_PREFIX.as_bytes()) {
// no checks here as they are performed above by direct reading
} else {
warn!(
"Key/value does not correspond to any prefix: serialized_key: {:?}, serialized_value: {:?}",
serialized_key, serialized_value
);
return Err(anyhow!(""));
// return false;
return Err(anyhow!(
"Key/value does not correspond to any prefix: serialized_key: {:?}, serialized_value: {:?}",
serialized_key, serialized_value
));
}
}

for (serialized_key, serialized_value) in
db.iterator_cf(VERSIONING_CF, MassaIteratorMode::Start)
{
if serialized_key.starts_with(MIP_STORE_PREFIX.as_bytes())
|| serialized_key.starts_with(MIP_STORE_STATS_PREFIX.as_bytes())
{
if !self
.mip_store
.is_key_value_valid(&serialized_key, &serialized_value)
{
warn!("Wrong key/value for MIP Store");
return Err(anyhow!(
"Wrong key/value for MIP Store serialized_key: {:?}, serialized_value: {:?}",
serialized_key, serialized_value
));
}
} else {
warn!(
"Key/value does not correspond to any prefix: serialized_key: {:?}, serialized_value: {:?}",
serialized_key, serialized_value
);
return Err(anyhow!(
"Key/value does not correspond to any prefix: serialized_key: {:?}, serialized_value: {:?}",
serialized_key, serialized_value
));
}
}

Expand Down
2 changes: 1 addition & 1 deletion massa-grpc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_grpc"
version = "0.27.0"
version = "0.27.1"
edition = "2021"
description = "GRPC API for Massa Blockchain"
repository = "https://github.com/massalabs/massa/"
Expand Down
2 changes: 1 addition & 1 deletion massa-hash/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_hash"
version = "0.27.0"
version = "0.27.1"
authors = ["Massa Labs <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion massa-ledger-exports/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_ledger_exports"
version = "0.27.0"
version = "0.27.1"
authors = ["Massa Labs <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion massa-ledger-worker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_ledger_worker"
version = "0.27.0"
version = "0.27.1"
authors = ["Massa Labs <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion massa-logging/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_logging"
version = "0.27.0"
version = "0.27.1"
authors = ["Massa Labs <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion massa-metrics/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_metrics"
version = "0.27.0"
version = "0.27.1"
edition = "2021"

[features]
Expand Down
2 changes: 1 addition & 1 deletion massa-models/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_models"
version = "0.27.0"
version = "0.27.1"
authors = ["Massa Labs <[email protected]>"]
edition = "2021"

Expand Down
6 changes: 3 additions & 3 deletions massa-models/src/config/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ lazy_static::lazy_static! {
)
)
} else {
MassaTime::from_millis(1700496600000) // Wednesday, November 20, 2023 16:10:00 UTC
MassaTime::from_millis(1701093600000) // Monday, November 27, 2023 14:00:00 UTC
};

/// TESTNET: time when the blockclique is ended.
Expand All @@ -77,9 +77,9 @@ lazy_static::lazy_static! {
/// node version
pub static ref VERSION: Version = {
if cfg!(feature = "sandbox") {
"SAND.27.0"
"SAND.27.1"
} else {
"SECU.27.0"
"SECU.27.1"
}
.parse()
.unwrap()
Expand Down
2 changes: 1 addition & 1 deletion massa-module-cache/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_module_cache"
version = "0.27.0"
version = "0.27.1"
edition = "2021"

[features]
Expand Down
2 changes: 1 addition & 1 deletion massa-node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa-node"
version = "0.27.0"
version = "0.27.1"
authors = ["Massa Labs <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion massa-pool-exports/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_pool_exports"
version = "0.27.0"
version = "0.27.1"
authors = ["Massa Labs <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion massa-pool-worker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_pool_worker"
version = "0.27.0"
version = "0.27.1"
authors = ["Massa Labs <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion massa-pos-exports/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_pos_exports"
version = "0.27.0"
version = "0.27.1"
authors = ["Massa Labs <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion massa-pos-worker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_pos_worker"
version = "0.27.0"
version = "0.27.1"
authors = ["Massa Labs <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion massa-protocol-exports/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_protocol_exports"
version = "0.27.0"
version = "0.27.1"
authors = ["Massa Labs <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion massa-protocol-worker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_protocol_worker"
version = "0.27.0"
version = "0.27.1"
authors = ["Massa Labs <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion massa-sdk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_sdk"
version = "0.27.0"
version = "0.27.1"
edition = "2021"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion massa-serialization/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_serialization"
version = "0.27.0"
version = "0.27.1"
authors = ["Massa Labs <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion massa-signature/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_signature"
version = "0.27.0"
version = "0.27.1"
authors = ["Massa Labs <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion massa-storage/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_storage"
version = "0.27.0"
version = "0.27.1"
authors = ["Massa Labs <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion massa-test-framework/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "massa_test_framework"
version = "0.27.0"
version = "0.27.1"
authors = ["Massa Labs <[email protected]>"]
edition = "2021"

Expand Down
Loading

0 comments on commit 1f32b9d

Please sign in to comment.