diff --git a/scripts/build/build-bundle.sh b/scripts/build/build-bundle.sh index b9a71b2..03faf19 100755 --- a/scripts/build/build-bundle.sh +++ b/scripts/build/build-bundle.sh @@ -329,7 +329,6 @@ build_bundle::build_binaries() { if [ -n "${NOMOS_EXTRA_FEATURES:-}" ]; then FEATURES="${FEATURES},${NOMOS_EXTRA_FEATURES}" fi - echo "==> Building binaries (platform=${PLATFORM})" mkdir -p "${NODE_SRC}" ( @@ -349,7 +348,14 @@ build_bundle::build_binaries() { if [ -z "${NOMOS_NODE_PATH}" ]; then build_bundle::apply_nomos_node_patches "${NODE_SRC}" fi - + if [ -f "${CIRCUITS_DIR}/zksign/verification_key.json" ] \ + || [ -f "${CIRCUITS_DIR}/pol/verification_key.json" ] \ + || [ -f "${CIRCUITS_DIR}/poq/verification_key.json" ] \ + || [ -f "${CIRCUITS_DIR}/poc/verification_key.json" ]; then + export CARGO_FEATURE_BUILD_VERIFICATION_KEY=1 + else + unset CARGO_FEATURE_BUILD_VERIFICATION_KEY + fi if [ -n "${BUNDLE_RUSTUP_TOOLCHAIN}" ]; then RUSTFLAGS='--cfg feature="pol-dev-mode"' NOMOS_CIRCUITS="${CIRCUITS_DIR}" \ RUSTUP_TOOLCHAIN="${BUNDLE_RUSTUP_TOOLCHAIN}" \ diff --git a/scripts/run/run-examples.sh b/scripts/run/run-examples.sh index 0515d18..9a3d872 100755 --- a/scripts/run/run-examples.sh +++ b/scripts/run/run-examples.sh @@ -342,9 +342,11 @@ run_examples::bundle_matches_expected() { echo "Bundle ${tar_path} is for nomos-node rev ${tar_rev}, expected ${NOMOS_NODE_REV}; rebuilding." >&2 return 1 fi - if [ -n "${tar_head}" ] && [ "${tar_head}" != "${NOMOS_NODE_REV}" ]; then - echo "Bundle ${tar_path} is for nomos-node git head ${tar_head}, expected ${NOMOS_NODE_REV}; rebuilding." >&2 - return 1 + if [ -n "${tar_head}" ] && echo "${NOMOS_NODE_REV}" | grep -Eq '^[0-9a-f]{7,40}$'; then + if [ "${tar_head}" != "${NOMOS_NODE_REV}" ]; then + echo "Bundle ${tar_path} is for nomos-node git head ${tar_head}, expected ${NOMOS_NODE_REV}; rebuilding." >&2 + return 1 + fi fi return 0 } diff --git a/testing-framework/core/src/nodes/common/config/injection.rs b/testing-framework/core/src/nodes/common/config/injection.rs index 817751b..7682010 100644 --- a/testing-framework/core/src/nodes/common/config/injection.rs +++ b/testing-framework/core/src/nodes/common/config/injection.rs @@ -44,6 +44,23 @@ pub fn inject_blend_non_ephemeral_signing_key_id(yaml_value: &mut Value) { blend.insert(key_id_key, Value::String(key_id)); } +/// Inject deployment chain sync protocol name when missing. +pub fn inject_chain_sync_protocol_name(yaml_value: &mut Value) { + let Some(network) = deployment_network_section(yaml_value) else { + return; + }; + + let key = Value::String("chain_sync_protocol_name".into()); + if network.contains_key(&key) { + return; + } + + network.insert( + key, + Value::String("/integration/nomos/cryptarchia/sync/1.0.0".into()), + ); +} + fn cryptarchia_section(yaml_value: &mut Value) -> Option<&mut Mapping> { yaml_value .as_mapping_mut() @@ -58,6 +75,15 @@ fn blend_section(yaml_value: &mut Value) -> Option<&mut Mapping> { .and_then(Value::as_mapping_mut) } +fn deployment_network_section(yaml_value: &mut Value) -> Option<&mut Mapping> { + yaml_value + .as_mapping_mut() + .and_then(|root| root.get_mut(&Value::String("deployment".into()))) + .and_then(Value::as_mapping_mut) + .and_then(|deployment| deployment.get_mut(&Value::String("network".into()))) + .and_then(Value::as_mapping_mut) +} + fn ensure_network_adapter(cryptarchia: &mut Mapping) { if cryptarchia.contains_key(&Value::String("network_adapter_settings".into())) { return; diff --git a/testing-framework/core/src/nodes/common/node.rs b/testing-framework/core/src/nodes/common/node.rs index 3b3fa59..89a4037 100644 --- a/testing-framework/core/src/nodes/common/node.rs +++ b/testing-framework/core/src/nodes/common/node.rs @@ -187,6 +187,7 @@ fn write_node_config(config: &C, config_path: &Path) -> Result<(), super::lifecycle::spawn::write_config_with_injection(config, config_path, |yaml| { crate::nodes::common::config::injection::inject_ibd_into_cryptarchia(yaml); crate::nodes::common::config::injection::inject_blend_non_ephemeral_signing_key_id(yaml); + crate::nodes::common::config::injection::inject_chain_sync_protocol_name(yaml); }) .map_err(|source| SpawnNodeError::WriteConfig { path: config_path.to_path_buf(),