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

Conditionally compile versions #2559

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/cargo-features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ concurrency:

jobs:
cargo-features:
runs-on: ubuntu-latest
runs-on: buildjet-8vcpu-ubuntu-2204
steps:
- uses: taiki-e/install-action@cargo-hack

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ concurrency:

env:
RUST_LOG: info,libp2p=off,node=error
RUSTFLAGS: "--cfg feature=\"fee\" --cfg feature=\"marketplace\""
CARGO_TERM_COLOR: always
# Save the process compose logs
PC_LOGS: /tmp/pc.log
Expand Down
7 changes: 0 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,6 @@ rand = "0.8.5"
time = "0.3"
trait-set = "0.3.0"

[profile.dev]
# No optimizations
opt-level = 0
# Skip compiling the debug information.
debug = false
# Skip linking symbols.
strip = true
[profile.test]
opt-level = 1
[profile.test.package.tests]
Expand Down
4 changes: 4 additions & 0 deletions sequencer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
default = ["fee"]
testing = [
"hotshot-testing",
"marketplace-builder-core",
Expand All @@ -15,6 +16,9 @@ testing = [
]
benchmarking = []
embedded-db = ["hotshot-query-service/embedded-db"]
fee = []
pos = []
marketplace = []

[[bin]]
name = "espresso-dev-node"
Expand Down
4 changes: 4 additions & 0 deletions sequencer/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use super::{
persistence, Genesis, L1Params, NetworkParams,
};
use clap::Parser;
#[allow(unused_imports)]
use espresso_types::{
traits::NullEventConsumer, FeeVersion, MarketplaceVersion, SequencerVersions,
SolverAuctionResultsProvider, V0_0,
Expand Down Expand Up @@ -38,6 +39,7 @@ pub async fn main() -> anyhow::Result<()> {
let upgrade = genesis.upgrade_version;

match (base, upgrade) {
#[cfg(all(feature = "fee", feature = "marketplace"))]
(FeeVersion::VERSION, MarketplaceVersion::VERSION) => {
run(
genesis,
Expand All @@ -47,6 +49,7 @@ pub async fn main() -> anyhow::Result<()> {
)
.await
}
#[cfg(feature = "fee")]
(FeeVersion::VERSION, _) => {
run(
genesis,
Expand All @@ -56,6 +59,7 @@ pub async fn main() -> anyhow::Result<()> {
)
.await
}
#[cfg(feature = "marketplace")]
(MarketplaceVersion::VERSION, _) => {
run(
genesis,
Expand Down
Loading