All interface-affecting changes to
apexchainx-contractsare recorded here. This project adheres to Semantic Versioning and follows Keep a Changelog conventions.
docs/CONTRACT_MAINTENANCE_POLICY.md— comprehensive maintenance policy covering#[contracttype]compatibility notes (#279), response-shape stability (#283), version negotiation (#284), API archetypes (#285), event payload size checks (#286), event drift review (#287), history write audit (#288), telemetry counters (#289), and role-change incident review (#290)RESULT_SCHEMA_FIELD_COUNTconstant — compile-time sentinel recording the number of named fields inSLAResult; must be updated alongsideRESULT_SCHEMA_VERSIONwhen the result layout changes (#255)SLAResultSchema::result_field_count— exposesRESULT_SCHEMA_FIELD_COUNTto backend consumers viaget_result_schema()so they can detect layout drift at runtime (#255)schema_migration_tests.rs— CI-backed guardrail tests forget_result_schema(): exhaustiveSLAResultdestructure (compile-time gate), field count sentinel, symbol stability, deprecated-symbols invariant, andget_config_bundleconsistency (closes #255)docs/result-schema-migration-guard.md— documentation for the result schema migration process, describing the two-level guardrail, step-by-step change process, and backend consumer guidance (closes #255)tooling/release-summary.ts— release summary generator for maintainers (#280).devcontainer/— reproducible dev container workspace with Rust + WASM target + just + Node.js (#281)just bootstraptarget — one-command local environment setup (#281)- Historical parity checker test (
test_historical_parity_golden_results) — validates current contract behavior against known golden results for release regression detection (#282) get_config_version_hash— deterministic hash of the current config snapshot for backend parity validationget_result_schema— explicit schema descriptor for SLA result encoding (status, payment type, rating symbols)calculate_sla_view— read-only simulation of SLA calculation without state mutation or auth requirementget_config_snapshot— ordered snapshot of all severity configs with version tagmigrate— admin-only migration function to bump the storage schema version (SC-021)get_admin— read the current admin address- Two-step admin transfer governance functions:
propose_admin,accept_admin,cancel_admin_proposal, andget_pending_admin(SC-024, SC-063) - Two-step operator handoff governance functions:
propose_operator,accept_operator,cancel_operator_proposal, andget_pending_operator(SC-024, SC-064) renounce_admin— admin-only irreversible governance renouncement (SC-065)is_paused— query if the contract is pausedget_pause_info— query pause reason, timestamp, and initiator metadatalist_configs— read all severity configurations as a Mapget_last_config_update— cheap invalidation check returning metadata (ledger sequence) on the most recent configuration update (#4)get_failure_schema— returns the full catalogue of typed failure codes mapping numeric error codes to machine-readable labels and descriptions (SC-W5-046)get_config_bundle— combines configuration snapshot and result schema in a single read for one-shot backend bootstrapping (#1)get_contract_metadata— returns static contract capabilities including features, supported severities, storage/result schema versions (SC-060)prune_history_by_age— admin-only history compaction removing entries older than a specified duration (SC-063)- Paginated history access:
get_history_pagereturning bounded history page (SC-059) get_history_by_outage— query all history entries matching a given outage identifier (SC-060)get_latest_by_outage— query the most recent history entry for a given outage identifier (SC-061)get_config_count— read total number of configured severity tiers (SC-079)get_storage_version— query the current storage version stamped in storage- Configurable retention limit functions:
set_retention_limitandget_retention_limit(SC-013) get_migration_state— query storage version and migration posture (SC-021)get_version_info— version negotiation snapshot for backend startup handshake (SC-W5-029)- Event Correlation IDs — cross-contract tracing via deterministic correlation IDs generated by
generate_correlation_idfrom ledger sequence and formatted withcorrelation_event_topics(SC-W5-079) - Settlement Intent Event (
set_int) — Published on everycalculate_slacall alongsidesla_calcevent for backend reconciliation. It uses topics(set_int, v1, severity)and payload(outage_id: Symbol, status: Symbol, payment_type: Symbol, amount: i128, config_version_hash: u64, recorded_at: u64)(SC-W5-041) docs/AUDIT_TRAIL.md— human-readable one-pager cataloguing every event topic, payload field, emission site, and backend recovery implication, sourced directly fromevent_schema.rsand theEVENT_*constants inlib.rs(closes #106)
pausenow requires areason: Stringparameter, records pause metadata (reason, timestamp, initiator), and emits an event payload with the paused status (breaking)calculate_slanow:- Emits a settlement intent event (
set_int) alongside the SLA calculation event - Enforces a configurable retention limit (SC-013) and drops the oldest entry when the limit is exceeded (SC-062)
- Performs configuration parameter validation (SC-W5-046)
- Emits a settlement intent event (
get_statsnow returns aSLAStatsstruct; callers should use field access rather than tuple destructuring- History entries returned by
get_historyincludeschema_versionfor result envelope versioning
set_operator— admin-only function to update the operator addresspause/unpause— admin-only controls;calculate_slapanics withContractPausedwhen pausedget_operator— read the current operator address
calculate_slanow requires theoperatoraddress as the first argument (breaking)SLAErrorextended withContractPaused = 6
get_stats— cumulative totals for calculations, violations, rewards, penaltiesget_history— ordered log of recent SLA calculation resultsprune_history— admin-only compaction to bound on-chain storage
initialize(admin, operator)— one-time setup; stores roles and default severity configsset_config(caller, severity, threshold_minutes, penalty_per_minute, reward_base)— admin-only config updateget_config(severity)— read a single severity configcalculate_sla(caller, outage_id, severity, mttr_minutes)— operator-gated SLA calculation
When making an interface-affecting change, follow these steps:
- Add an entry under
[Unreleased]in the appropriate section (Added,Changed,Removed,Fixed) - Use exact function names as they appear in the contract interface
- Mark breaking changes explicitly with (breaking)
- On release, rename
[Unreleased]to the version tag and date, then open a fresh[Unreleased]block
| Category | Usage |
|---|---|
Added |
New functions, features, or parameters |
Changed |
Modifications to existing behavior (non-breaking) |
Fixed |
Bug fixes or corrections |
Removed |
Deprecated or deleted functionality |
Security |
Vulnerability patches or security improvements |