Skip to content
Merged
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
4 changes: 2 additions & 2 deletions buf.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ deps:
commit: 65537c618a924482b0d5ed51230d92dd
digest: b5:318583e5fbf4c8a0f651648509d5ccccb57fd8a6c1c7bb70df261b155367728ba5804450c5ae05b9e60d2c59a62e36a2ec88bf2822d749f54d286c1b0170b9f5
- name: buf.build/googleapis/googleapis
commit: 536964a08a534d51b8f30f2d6751f1f9
digest: b5:3e05d27e797b00c345fadd3c15cf0e16c4cc693036a55059721e66d6ce22a96264a4897658c9243bb0874fa9ca96e437589eb512189d2754604a626c632f6030
commit: c17df5b2beca46928cc87d5656bd5343
digest: b5:648a01e0170d4512dea7d564016165decd1ed6e34bef79fe54753e51ad7e27545709ad9157d7551270147d551155c595a2fb0bf5bb33b1c83040ddbce915c604
- name: buf.build/protocolbuffers/wellknowntypes
commit: 9d16d599a978406980f6e2f081331a93
digest: b5:dd06e497a5c52f5ddf6ec02b3c7d289cc6c0432093fc2f6bf7a4fb5fae786c3e4c893e55d2759ffb6833268daf3de0bce303a406fed15725790528f2c27dc219
2 changes: 1 addition & 1 deletion devnet/default-config/devnet-genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@
"supernode": {
"params": {
"reward_distribution": {
"payment_period_blocks": "100800",
"payment_period_blocks": "432000",
"registration_fee_share_bps": "200",
"min_cascade_bytes_for_payment": "1073741824",
"new_sn_ramp_up_periods": "4",
Expand Down
147 changes: 75 additions & 72 deletions docs/design/Cascade-Everlight-Funding-Model.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/static/openapi.yml

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions scripts/everlight-budget.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,23 @@ def compute_budget(hw_rate, storage_apr, p_lume, n_sn, b_sn_gib,
"""Return a dict with all derived budget numbers."""
seconds_per_period = period_blocks * block_time_sec
seconds_per_year = 365.25 * 86400
# 30-day reference month, so the default period (432000 blocks * 6s = 30 d)
# gives pool_period_usd == pool_monthly_usd exactly. The funding model doc
# uses HW_rate in $/GiB/month and treats one period as one month at default.
seconds_per_month = 30 * 86400
periods_per_year = seconds_per_year / seconds_per_period
weeks_per_month = (365.25 / 12) / 7 # ~= 4.348

per_byte_monthly_usd = hw_rate * (1 + storage_apr)
pool_monthly_usd = n_sn * b_sn_gib * per_byte_monthly_usd
pool_period_usd = pool_monthly_usd / weeks_per_month
# Per-period budget scales with the period length, independent of week/month assumptions.
pool_period_usd = pool_monthly_usd * (seconds_per_period / seconds_per_month)
pool_period_lume = pool_period_usd / p_lume
pool_annual_usd = pool_monthly_usd * 12
pool_annual_lume = pool_annual_usd / p_lume

return {
"seconds_per_period": seconds_per_period,
"periods_per_year": periods_per_year,
"weeks_per_month": weeks_per_month,
"per_byte_monthly_usd": per_byte_monthly_usd,
"total_fleet_gib": n_sn * b_sn_gib,
"pool_monthly_usd": pool_monthly_usd,
Expand All @@ -61,7 +64,7 @@ def main():
help="Active eligible SuperNode count")
p.add_argument("--b-sn-gib", type=float, default=3072,
help="Average per-SN cascade bytes in GiB (default 3072 = 3 TiB)")
p.add_argument("--period-blocks", type=int, default=100800,
p.add_argument("--period-blocks", type=int, default=432000,
help="payment_period_blocks")
p.add_argument("--block-time-sec", type=float, default=6.0,
help="Average block time in seconds")
Expand All @@ -85,7 +88,6 @@ def main():
print(f" Total fleet bytes: {r['total_fleet_gib']:,.0f} GiB "
f"({r['total_fleet_gib'] / 1024:.2f} TiB / {r['total_fleet_gib'] / 1024 / 1024:.2f} PiB)")
print(f" Periods per year: {r['periods_per_year']:.2f}")
print(f" Weeks per month: {r['weeks_per_month']:.4f}")
print()
print("Pool budget:")
print(f" Per period: ${r['pool_period_usd']:,.2f} "
Expand Down
13 changes: 5 additions & 8 deletions scripts/everlight-endowment.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@

def compute_endowment(hw_rate, storage_apr, p_lume, n_sn, b_sn_gib,
staking_apr, risk_buffer_bps,
period_blocks, block_time_sec,
p_lume_at_sizing=None):
"""Return a dict with annual outflow and principal sizing."""
weeks_per_month = (365.25 / 12) / 7
"""Return a dict with annual outflow and principal sizing.

Note: principal sizing is purely annualized — payout cadence
(payment_period_blocks) does not affect the required principal.
"""
p_lume_sizing = p_lume_at_sizing if p_lume_at_sizing is not None else p_lume

per_byte_monthly_usd = hw_rate * (1 + storage_apr)
Expand Down Expand Up @@ -88,16 +90,11 @@ def main():
help="Validator staking APR (LUME yield earned by principal)")
p.add_argument("--risk-buffer-bps", type=int, default=0,
help="Slashing risk buffer in basis points (e.g., 500 = 5%%)")
p.add_argument("--period-blocks", type=int, default=100800,
help="payment_period_blocks")
p.add_argument("--block-time-sec", type=float, default=6.0,
help="Average block time in seconds")
args = p.parse_args()

r = compute_endowment(args.hw_rate, args.storage_apr, args.p_lume,
args.n_sn, args.b_sn_gib,
args.staking_apr, args.risk_buffer_bps,
args.period_blocks, args.block_time_sec,
args.p_lume_at_sizing)

print("Inputs:")
Expand Down
10 changes: 7 additions & 3 deletions scripts/everlight-sn-reward.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ def compute_sn_reward(sn_storage_gib, hw_rate, storage_apr, p_lume,
period_blocks, block_time_sec):
"""Return per-SN reward dict at the given chain-wide policy."""
seconds_per_period = period_blocks * block_time_sec
weeks_per_month = (365.25 / 12) / 7 # ~= 4.348
# 30-day reference month, so the default period (432000 blocks * 6s = 30 d)
# gives sn_period_usd == sn_monthly_usd exactly. The funding model doc uses
# HW_rate in $/GiB/month and treats one period as one month at default.
seconds_per_month = 30 * 86400

per_byte_monthly_usd = hw_rate * (1 + storage_apr)

Expand All @@ -46,7 +49,8 @@ def compute_sn_reward(sn_storage_gib, hw_rate, storage_apr, p_lume,
}

sn_monthly_usd = sn_storage_gib * per_byte_monthly_usd
sn_period_usd = sn_monthly_usd / weeks_per_month
# Per-period reward scales with the period length, independent of week/month assumptions.
sn_period_usd = sn_monthly_usd * (seconds_per_period / seconds_per_month)
sn_period_lume = sn_period_usd / p_lume
sn_annual_usd = sn_monthly_usd * 12

Expand Down Expand Up @@ -81,7 +85,7 @@ def main():
help="Storage APR paid to operators, as fraction")
p.add_argument("--p-lume", type=float, default=0.30,
help="LUME spot price in USD")
p.add_argument("--period-blocks", type=int, default=100800,
p.add_argument("--period-blocks", type=int, default=432000,
help="payment_period_blocks")
p.add_argument("--block-time-sec", type=float, default=6.0,
help="Average block time in seconds")
Expand Down
7 changes: 5 additions & 2 deletions x/action/v1/types/metadata.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion x/supernode/v1/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const (
var DefaultRequiredOpenPorts = []uint32{4444, 4445, 8002}

var DefaultRewardDistribution = &RewardDistribution{
PaymentPeriodBlocks: 100800, // ~7 days at 6s blocks
PaymentPeriodBlocks: 432000, // ~30 days at 6s blocks
RegistrationFeeShareBps: 200, // 2%
MinCascadeBytesForPayment: 1073741824, // 1 GiB
NewSnRampUpPeriods: 4,
Expand Down
3 changes: 3 additions & 0 deletions x/supernode/v1/types/params.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 19 additions & 5 deletions x/supernode/v1/types/supernode_state.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading