Skip to content
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
491 changes: 490 additions & 1 deletion docs/adr/ADR-0006-receiver-side-revenue-floor.md

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions docs/adr/ADR-0008-storage-economics-and-payment-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ and a node that was actually paid is nominated for a first audit.
| Node re-verification of **non-paid** quotes in the bundle | not done (bad signature on an unpaid quote is accepted) |
| Node rejection of off-curve quotes (`QUOTE_ARITHMETIC_RECHECK_ENABLED`) | **enforced**, on every quote in the bundle |
| Quote/commitment mismatch reported to trust | off (telemetry only) |
| Receiver-side price floor (ADR-0006) | shadow (`ANT_PRICE_FLOOR_ENFORCE`, 65% tolerance), priced against the **close group's median** committed count, not the receiver's own; the own-price basis was withdrawn after canary measurement |
| Receiver-side price floor (ADR-0006) | **enforced** on every node at 30% of a reference price: the **close group's median** committed-count price, capped at the receiver's own; covers client PUT, fresh replication and paid-list admission; no per-node switch (ADR-0006 Amendment 2) |
| Payee eligibility gate (ADR-0005) | **not merged**; observe-only on its branch (`ADR5_ENFORCE`) |
| Client pays the 3× multiplier on the merkle path | **enforced** by the published client, immediately and unconditionally (no flag, no date) |
| Storer requires it (`MERKLE_PARITY_ENFORCED_FROM_UNIX`) | **enforced** by upgraded nodes, for receipts stamped from 2026-08-04 15:00 UTC onward |
Expand Down Expand Up @@ -452,7 +452,9 @@ indistinguishable from a single receipt.
mechanism to reprice.
- **Median-of-K is only as honest as the quote set the client presents.** A
modified client can shop the neighbourhood and settle the cheapest valid
quote; the receiver-side floor is the counterweight and is not yet enforcing.
quote. The receiver-side floor, enforced on every node (ADR-0006 Amendment
2), is the counterweight: it refuses near-empty quotes, but not the
cheapest member of the close group.

### Neutral / Operational

Expand Down
3 changes: 1 addition & 2 deletions src/devnet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::ant_protocol::CHUNK_PROTOCOL_ID;
use crate::config::{default_root_dir, NODES_SUBDIR, NODE_IDENTITY_FILENAME};
use crate::logging::{debug, info, warn};
use crate::payment::{
EvmVerifierConfig, PaymentVerifier, PaymentVerifierConfig, PriceFloorConfig, QuoteGenerator,
EvmVerifierConfig, PaymentVerifier, PaymentVerifierConfig, QuoteGenerator,
QuotingMetricsTracker,
};
use crate::replication::config::ReplicationConfig;
Expand Down Expand Up @@ -960,7 +960,6 @@ impl Devnet {
cache_capacity: DEVNET_PAYMENT_CACHE_CAPACITY,
close_group_size: replication_config.close_group_size,
local_rewards_address: rewards_address,
price_floor: PriceFloorConfig::default(),
};
let payment_verifier = PaymentVerifier::new(payment_config);
let metrics_tracker = QuotingMetricsTracker::new(DEVNET_INITIAL_RECORDS);
Expand Down
13 changes: 1 addition & 12 deletions src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ use crate::event::{create_event_channel, NodeEvent, NodeEventsChannel, NodeEvent
use crate::logging::{debug, error, info, warn};
use crate::payment::metrics::QuotingMetricsTracker;
use crate::payment::wallet::parse_rewards_address;
use crate::payment::{
EvmVerifierConfig, PaymentVerifier, PaymentVerifierConfig, PriceFloorConfig, QuoteGenerator,
};
use crate::payment::{EvmVerifierConfig, PaymentVerifier, PaymentVerifierConfig, QuoteGenerator};
use crate::replication::config::ReplicationConfig;
use crate::replication::fresh::FreshWriteEvent;
use crate::replication::ReplicationEngine;
Expand Down Expand Up @@ -504,16 +502,7 @@ impl NodeBuilder {
cache_capacity: config.payment.cache_capacity,
close_group_size,
local_rewards_address: rewards_address,
// Shadow mode by default; enforcement is a per-node canary opt-in
// via ANT_PRICE_FLOOR_ENFORCE (see PriceFloorConfig).
price_floor: PriceFloorConfig::from_env(),
};
if payment_config.price_floor.enforce {
info!(
"Price floor ENFORCEMENT enabled (tolerance {}%)",
payment_config.price_floor.tolerance_percent
);
}
let payment_verifier = PaymentVerifier::new(payment_config);
let metrics_tracker = QuotingMetricsTracker::new(0);
let mut quote_generator = QuoteGenerator::new(rewards_address, metrics_tracker);
Expand Down
5 changes: 2 additions & 3 deletions src/payment/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ pub use ant_protocol::payment::verify::{
};
pub use single_node::SingleNodePayment;
pub use verifier::{
EvmVerifierConfig, PaymentStatus, PaymentVerifier, PaymentVerifierConfig, PriceFloorConfig,
VerificationContext, MAX_PAYMENT_PROOF_SIZE_BYTES, MIN_PAYMENT_PROOF_SIZE_BYTES,
PRICE_FLOOR_ENFORCE_ENV, PRICE_FLOOR_TOLERANCE_ENV,
EvmVerifierConfig, PaymentStatus, PaymentVerifier, PaymentVerifierConfig, VerificationContext,
MAX_PAYMENT_PROOF_SIZE_BYTES, MIN_PAYMENT_PROOF_SIZE_BYTES, PRICE_FLOOR_TOLERANCE_PERCENT,
};
pub use wallet::{is_valid_address, parse_rewards_address, WalletConfig};
Loading
Loading