testing: build real VKs and inject chain sync

This commit is contained in:
andrussal 2026-01-15 15:42:45 +01:00
parent a4e8438d3f
commit 416ec051a5
4 changed files with 40 additions and 5 deletions

View File

@ -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}" \

View File

@ -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
}

View File

@ -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;

View File

@ -187,6 +187,7 @@ fn write_node_config<C: Serialize>(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(),