Skip to content

Commit 979036e

Browse files
authored
Fix builder versions (#3614)
* fix builder versions * build 0.4 fix * nightly fmt
1 parent bc4f992 commit 979036e

File tree

1 file changed

+45
-9
lines changed

1 file changed

+45
-9
lines changed

crates/builder/src/bin/permissionless-builder.rs

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ use std::{num::NonZeroUsize, path::PathBuf, time::Duration};
22

33
use builder::non_permissioned::{build_instance_state, BuilderConfig};
44
use clap::Parser;
5-
use espresso_types::{eth_signature_key::EthKeyPair, parse_duration, SequencerVersions};
5+
use espresso_types::{
6+
eth_signature_key::EthKeyPair, parse_duration, FeeVersion, SequencerVersions,
7+
};
68
use futures::future::pending;
79
use hotshot::traits::ValidatedState;
810
use hotshot_types::{
@@ -113,26 +115,60 @@ async fn main() -> anyhow::Result<()> {
113115
let upgrade = genesis.upgrade_version;
114116

115117
match (base, upgrade) {
118+
#[cfg(all(feature = "pos", feature = "drb-and-header"))]
119+
(
120+
espresso_types::EpochVersion::VERSION,
121+
espresso_types::DrbAndHeaderUpgradeVersion::VERSION,
122+
) => {
123+
run::<SequencerVersions<espresso_types::FeeVersion, espresso_types::EpochVersion>>(
124+
genesis, opt,
125+
)
126+
.await
127+
},
128+
#[cfg(all(feature = "fee", feature = "drb-and-header"))]
129+
(
130+
espresso_types::FeeVersion::VERSION,
131+
espresso_types::DrbAndHeaderUpgradeVersion::VERSION,
132+
) => {
133+
run::<
134+
SequencerVersions<
135+
espresso_types::FeeVersion,
136+
espresso_types::DrbAndHeaderUpgradeVersion,
137+
>,
138+
>(genesis, opt)
139+
.await
140+
},
141+
#[cfg(feature = "drb-and-header")]
142+
(espresso_types::DrbAndHeaderUpgradeVersion::VERSION, _) => {
143+
run::<
144+
SequencerVersions<
145+
espresso_types::DrbAndHeaderUpgradeVersion,
146+
espresso_types::DrbAndHeaderUpgradeVersion,
147+
>,
148+
>(genesis, opt)
149+
.await
150+
},
116151
#[cfg(all(feature = "fee", feature = "pos"))]
117-
(espresso_types::FeeVersion::VERSION, espresso_types::EpochVersion::VERSION) => {
152+
(FeeVersion::VERSION, espresso_types::EpochVersion::VERSION) => {
118153
run::<SequencerVersions<espresso_types::FeeVersion, espresso_types::EpochVersion>>(
119154
genesis, opt,
120155
)
121156
.await
122157
},
123158
#[cfg(feature = "pos")]
124-
(espresso_types::EpochVersion::VERSION, _) => {
125-
// Specifying V0_0 disables upgrades
126-
run::<SequencerVersions<espresso_types::EpochVersion, espresso_types::V0_0>>(
159+
(espresso_types::EpochVersion::VERSION, espresso_types::EpochVersion::VERSION) => {
160+
run::<SequencerVersions<espresso_types::EpochVersion, espresso_types::EpochVersion>>(
127161
genesis, opt,
162+
// Specifying V0_0 disables upgrades
128163
)
129164
.await
130165
},
131166
#[cfg(feature = "fee")]
132-
(espresso_types::FeeVersion::VERSION, _) => {
133-
// Specifying V0_0 disables upgrades
134-
run::<SequencerVersions<espresso_types::FeeVersion, espresso_types::V0_0>>(genesis, opt)
135-
.await
167+
(FeeVersion::VERSION, espresso_types::FeeVersion::VERSION) => {
168+
run::<SequencerVersions<espresso_types::FeeVersion, espresso_types::FeeVersion>>(
169+
genesis, opt,
170+
)
171+
.await
136172
},
137173
_ => panic!(
138174
"Invalid base ({base}) and upgrade ({upgrade}) versions specified in the toml file."

0 commit comments

Comments
 (0)