diff --git a/metrics/scripts/grafana-provisioning/dashboards/testnet-monitor.json b/metrics/scripts/grafana-provisioning/dashboards/testnet-monitor.json index 770a5f6fb..a46981342 100644 --- a/metrics/scripts/grafana-provisioning/dashboards/testnet-monitor.json +++ b/metrics/scripts/grafana-provisioning/dashboards/testnet-monitor.json @@ -8617,7 +8617,7 @@ ], "orderByTime": "ASC", "policy": "default", - "query": "SELECT last(\"bank_height\") as \"bank_height\" FROM \"$testnet\".\"autogen\".\"bank-new_from_parent-heights\" WHERE host_id::tag =~ /$hostid/ AND $timeFilter GROUP BY time($__interval)", + "query": "SELECT last(\"block_height\") as \"block_height\" FROM \"$testnet\".\"autogen\".\"bank-new_from_parent-heights\" WHERE host_id::tag =~ /$hostid/ AND $timeFilter GROUP BY time($__interval)", "rawQuery": true, "refId": "B", "resultFormat": "time_series", diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 08fe3e443..c0e5370da 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -214,8 +214,8 @@ pub struct Bank { /// Bank epoch epoch: Epoch, - /// Bank height in term of banks - bank_height: u64, + /// Bank block_height + block_height: u64, /// The pubkey to send transactions fees to. collector_id: Pubkey, @@ -320,7 +320,7 @@ impl Bank { epoch_schedule, rent_collector: parent.rent_collector.clone_with_epoch(epoch), max_tick_height: (slot + 1) * parent.ticks_per_slot - 1, - bank_height: parent.bank_height + 1, + block_height: parent.block_height + 1, fee_calculator: FeeCalculator::new_derived( &parent.fee_calculator, parent.signature_count(), @@ -345,7 +345,7 @@ impl Bank { datapoint_info!( "bank-new_from_parent-heights", ("slot_height", slot, i64), - ("bank_height", new.bank_height, i64) + ("block_height", new.block_height, i64) ); let stakers_epoch = epoch_schedule.get_stakers_epoch(slot); @@ -1423,6 +1423,11 @@ impl Bank { self.max_tick_height } + /// Return the block_height of this bank + pub fn block_height(&self) -> u64 { + self.block_height + } + /// Return the number of slots per epoch for the given epoch pub fn get_slots_in_epoch(&self, epoch: Epoch) -> u64 { self.epoch_schedule.get_slots_in_epoch(epoch)