Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

current_mip_version to get_status #4803

Merged
merged 1 commit into from
Jan 3, 2025
Merged
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
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ massa_event_cache = { path = "./massa-event-cache" }
# Massa projects dependencies
# massa-proto-rs = { git = "https://github.com/massalabs/massa-proto-rs", branch = "deferred_calls" }
# massa-sc-runtime = { git = "https://github.com/massalabs/massa-sc-runtime", "branch" = "deferred_calls" }
massa-proto-rs = { git = "https://github.com/massalabs/massa-proto-rs", "rev" = "b5267178eaf266ec724691d7de163e4c34343416" }
massa-sc-runtime = { git = "https://github.com/massalabs/massa-sc-runtime", "rev" = "f5a584b9f8050f332c9ed332bd0a40f8e0372807" }
massa-proto-rs = { git = "https://github.com/massalabs/massa-proto-rs", "rev" = "c9a7c55914f3d308996113df0936f15d96490313" }
massa-sc-runtime = { git = "https://github.com/massalabs/massa-sc-runtime", "rev" = "cd14c775aff31b8c0f49064613118f428f9dd45f" }

peernet = { git = "https://github.com/massalabs/PeerNet", "rev" = "04b05ddd320fbe76cc858115af7b5fc28bdb8310" }
# Dev only - use local dependencies
Expand Down
2 changes: 2 additions & 0 deletions massa-api-exports/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ pub struct NodeStatus {
pub chain_id: u64,
/// minimal fees to include an operation in a block
pub minimal_fees: Amount,
/// current mip version
pub current_mip_version: u32,
}

impl std::fmt::Display for NodeStatus {
Expand Down
7 changes: 7 additions & 0 deletions massa-api/src/public.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,12 @@ impl MassaRpcServer for API<Public> {
let config = CompactConfig::default();
let now = MassaTime::now();

let current_mip_version = self
.0
.keypair_factory
.mip_store
.get_network_version_current();

let last_slot_result = get_latest_block_slot_at_timestamp(
api_settings.thread_count,
api_settings.t0,
Expand Down Expand Up @@ -555,6 +561,7 @@ impl MassaRpcServer for API<Public> {
current_cycle,
chain_id: self.0.api_settings.chain_id,
minimal_fees: self.0.api_settings.minimal_fees,
current_mip_version,
})
}

Expand Down
1 change: 1 addition & 0 deletions massa-client/src/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ impl Output for NodeStatus {

println!();
println!("Chain id: {}", self.chain_id);
println!("Current MIP version: {}", self.current_mip_version);
}
}

Expand Down
1 change: 1 addition & 0 deletions massa-grpc/src/private.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ pub(crate) fn get_node_status(
execution_stats: Some(execution_stats.into()),
config: Some(config.into()),
chain_id: grpc.grpc_config.chain_id,
current_mip_version: grpc.mip_store.get_network_version_current(),
};

Ok(grpc_api::GetNodeStatusResponse {
Expand Down
1 change: 1 addition & 0 deletions massa-grpc/src/public.rs
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,7 @@ pub(crate) fn get_status(
config: Some(config.into()),
chain_id: grpc.grpc_config.chain_id,
minimal_fees: Some(grpc.grpc_config.minimal_fees.into()),
current_mip_version: grpc.keypair_factory.mip_store.get_network_version_current(),
};

Ok(grpc_api::GetStatusResponse {
Expand Down
8 changes: 6 additions & 2 deletions massa-node/base_config/openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -1999,7 +1999,6 @@
"candidate_value": {
"description": "The candidate datastore entry value bytes",
"$ref": "#/components/schemas/BytesOption"

},
"final_value": {
"description": "The final datastore entry value bytes",
Expand Down Expand Up @@ -2781,7 +2780,8 @@
"pool_stats",
"version",
"execution_stats",
"chain_id"
"chain_id",
"current_mip_version"
],
"type": "object",
"properties": {
Expand Down Expand Up @@ -2859,6 +2859,10 @@
"minimal_fees": {
"description": "Minimal fee",
"$ref": "#/components/schemas/Amount"
},
"current_mip_version": {
"description": "Current MIP version",
"type": "number"
}
},
"additionalProperties": false
Expand Down
Loading