Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Remove col_session_data usages
Browse files Browse the repository at this point in the history
  • Loading branch information
tdimitrov committed May 10, 2023
1 parent 96ffefe commit 81acb35
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 16 deletions.
2 changes: 0 additions & 2 deletions node/core/approval-voting/src/approval_db/v1/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,6 @@ pub type Bitfield = BitVec<u8, BitOrderLsb0>;
pub struct Config {
/// The column family in the database where data is stored.
pub col_approval_data: u32,
/// The column of the database where rolling session window data is stored.
pub col_session_data: u32,
}

/// Details pertaining to our assignment on a block.
Expand Down
6 changes: 2 additions & 4 deletions node/core/approval-voting/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,8 @@ impl ApprovalVotingSubsystem {
/// Revert to the block corresponding to the specified `hash`.
/// The operation is not allowed for blocks older than the last finalized one.
pub fn revert_to(&self, hash: Hash) -> Result<(), SubsystemError> {
let config = approval_db::v1::Config {
col_approval_data: self.db_config.col_approval_data,
col_session_data: self.db_config.col_session_data,
};
let config =
approval_db::v1::Config { col_approval_data: self.db_config.col_approval_data };
let mut backend = approval_db::v1::DbBackend::new(self.db.clone(), config);
let mut overlay = OverlayedBackend::new(&backend);

Expand Down
4 changes: 1 addition & 3 deletions node/core/dispute-coordinator/src/db/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,6 @@ fn candidate_votes_session_prefix(session: SessionIndex) -> [u8; 15 + 4] {
pub struct ColumnConfiguration {
/// The column in the key-value DB where data is stored.
pub col_dispute_data: u32,
/// The column in the key-value DB where session data is stored.
pub col_session_data: u32,
}

/// Tracked votes on candidates, for the purposes of dispute resolution.
Expand Down Expand Up @@ -378,7 +376,7 @@ mod tests {
let db = kvdb_memorydb::create(1);
let db = polkadot_node_subsystem_util::database::kvdb_impl::DbAdapter::new(db, &[0]);
let store = Arc::new(db);
let config = ColumnConfiguration { col_dispute_data: 0, col_session_data: 1 };
let config = ColumnConfiguration { col_dispute_data: 0 };
DbBackend::new(store, config, Metrics::default())
}

Expand Down
7 changes: 1 addition & 6 deletions node/core/dispute-coordinator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,11 @@ pub struct DisputeCoordinatorSubsystem {
pub struct Config {
/// The data column in the store to use for dispute data.
pub col_dispute_data: u32,
/// The data column in the store to use for session data.
pub col_session_data: u32,
}

impl Config {
fn column_config(&self) -> db::v1::ColumnConfiguration {
db::v1::ColumnConfiguration {
col_dispute_data: self.col_dispute_data,
col_session_data: self.col_session_data,
}
db::v1::ColumnConfiguration { col_dispute_data: self.col_dispute_data }
}
}

Expand Down
1 change: 0 additions & 1 deletion node/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1515,7 +1515,6 @@ fn revert_chain_selection(db: Arc<dyn Database>, hash: Hash) -> sp_blockchain::R
fn revert_approval_voting(db: Arc<dyn Database>, hash: Hash) -> sp_blockchain::Result<()> {
let config = approval_voting_subsystem::Config {
col_approval_data: parachains_db::REAL_COLUMNS.col_approval_data,
col_session_data: parachains_db::REAL_COLUMNS.col_session_window_data,
slot_duration_millis: Default::default(),
};

Expand Down

0 comments on commit 81acb35

Please sign in to comment.