Skip to content

Commit

Permalink
rename upgrade block field to view
Browse files Browse the repository at this point in the history
  • Loading branch information
imabdulbasit committed Jun 3, 2024
1 parent 727a7cd commit cc80ce3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions sequencer/src/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ pub enum UpgradeType {

#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Upgrade {
pub block: u64,
pub view: u64,
#[serde(flatten)]
pub upgrade_type: UpgradeType,
}
Expand All @@ -141,7 +141,7 @@ mod upgrade_serialization {
for (version, upgrade) in map {
seq.serialize_element(&(
version.to_string(),
upgrade.block,
upgrade.view,
upgrade.upgrade_type.clone(),
))?;
}
Expand Down Expand Up @@ -170,7 +170,7 @@ mod upgrade_serialization {
#[derive(Deserialize)]
struct UpgradeFields {
version: String,
block: u64,
view: u64,
#[serde(flatten)]
upgrade_type: UpgradeType,
}
Expand All @@ -187,7 +187,7 @@ mod upgrade_serialization {
map.insert(
version,
Upgrade {
block: fields.block,
view: fields.view,
upgrade_type: fields.upgrade_type,
},
);
Expand Down Expand Up @@ -251,7 +251,7 @@ mod test {

[[upgrade]]
version = "1.0"
block = 1
view = 1

[upgrade.chain_config]
chain_id = 12345
Expand Down
10 changes: 5 additions & 5 deletions sequencer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,12 +384,12 @@ pub async fn init_node<P: PersistenceOptions, Ver: StaticVersionType + 'static>(

let version = Ver::version();
if let Some(upgrade) = genesis.upgrades.get(&version) {
let block = upgrade.block;
let view = upgrade.view;
// >>>> ?????
config.config.start_proposing_view = block;
config.config.stop_proposing_view = block + 20;
config.config.start_voting_view = block + 21;
config.config.stop_proposing_view = block + 40;
config.config.start_proposing_view = view;
config.config.stop_proposing_view = view + 20;
config.config.start_voting_view = view + 21;
config.config.stop_proposing_view = view + 40;
}
let node_index = config.node_index;

Expand Down

0 comments on commit cc80ce3

Please sign in to comment.