Skip to content

AIP-2: Availability-Weighted Reward Mechanism#2

Merged
aerium-admin merged 10 commits into
mainfrom
aip-2
Sep 13, 2025
Merged

AIP-2: Availability-Weighted Reward Mechanism#2
aerium-admin merged 10 commits into
mainfrom
aip-2

Conversation

@ja7ad

@ja7ad ja7ad commented Sep 13, 2025

Copy link
Copy Markdown
Member

Pull Request

We have a GitHub bot that automatically merges certain PRs. Your PR will be merged immediately if it meets the following criteria:

  • The PR modifies only existing draft PRs.
  • The build passes successfully.
  • Your GitHub username or email address is listed in the Author header of all affected PRs, inside <triangular brackets>.
  • If matching by email address, it must be the one publicly listed on your GitHub profile.

PR Checklist

Please confirm that your PR meets the following requirements:

  • If submitting a new AIP, I used the suggested template: aip-template.md.
  • I have read and followed the proposal guidelines in AIP-1.

Thank you for contributing to Aerium Improvement Proposals! 🚀

Summary by CodeRabbit

  • Documentation

    • Added a new AIP draft describing an availability-weighted reward mechanism for validators, including scoring, reward-scaling, threshold behavior, examples, compatibility notes, test cases, and security considerations.
    • Updated README linting instructions to reference the correct style configuration location.
  • Bug Fixes

    • Fixed favicon/manifest links and improved page metadata so icons and page descriptions load reliably across contexts.

@ja7ad ja7ad requested a review from a team September 13, 2025 08:41
@coderabbitai

coderabbitai Bot commented Sep 13, 2025

Copy link
Copy Markdown

Walkthrough

Adds a new AIP draft describing an availability-weighted validator reward mechanism, updates README's MD lint example to reference config/.mdlrc.rb, and replaces parent-relative favicon references in the site head include with root-relative asset paths using the relative_url filter.

Changes

Cohort / File(s) Summary of Changes
New AIP Draft: Availability-Weighted Rewards
AIPs/aip-2.md
Adds a draft AIP defining an Availability Score in [0,1], exclusion threshold τ = 2/3 (≈0.666667), and reward scaling formula: reward = base_reward × (α + (1 − α) × score). Includes examples, updated test cases reflecting threshold-based exclusion, backwards-compatibility notes, security considerations, and front-matter metadata.
Docs: MD Lint Config Path
README.md
Updates example command to reference the style file at config/.mdlrc.rb instead of ./.mdlrc.rb.
Site: Favicon & Meta Adjustments
_includes/head.html
Adds favicon links using `{{ '/assets/favicons/...'

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant BP as BlockProducer
  participant VS as ValidatorSet
  participant AS as AvailabilityScoring
  participant RD as RewardDistributor

  BP->>VS: propose block (includes base rewards)
  VS->>AS: request availability scores for validators
  AS-->>VS: return scores (0.0–1.0)
  Note over VS,AS: threshold τ = 2/3 (≈0.666667)

  alt score < τ
    VS->>RD: mark validator excluded → reward = 0
  else score ≥ τ
    VS->>RD: send base_reward & score
    RD->>RD: compute reward = base_reward × (α + (1−α) × score)
  end

  RD-->>VS: finalized per-validator rewards
  VS-->>BP: commit distribution mapping
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I’m a rabbit counting hops and scores,
Thresholds, carrots, and ledger doors.
Favicons fixed, lint pointing true,
Rewards scale fair for me and you.
Little hops, bright changes — nibble through! 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "AIP-2: Availability-Weighted Reward Mechanism" succinctly and accurately captures the primary change — adding AIP-2 describing an availability-weighted reward mechanism — and is directly related to the changeset (AIPs/aip-2.md). It is concise, specific, and free of extraneous noise or vague wording, making it easy for teammates to understand the PR's main purpose when scanning history. Therefore it aligns with the PR title guidance.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch aip-2

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
AIPs/aip-2.md (1)

68-70: Reassess “Backwards Compatibility” statement

Excluding validators below a threshold materially changes reward distribution and committee composition. Clarify the impact and any migration/rollout plan.

Proposed wording:

  • “This change updates the reward distribution formula and introduces an exclusion threshold τ. While protocol data structures remain compatible, validator eligibility and per-block payouts change. Rollout should include an announcement period and staged activation (e.g., activate τ after N epochs).”
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • MCP integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between f21d295 and 7ede206.

📒 Files selected for processing (3)
  • AIPs/aip-2.md (1 hunks)
  • README.md (1 hunks)
  • _includes/head.html (1 hunks)
🔇 Additional comments (1)
README.md (1)

52-52: Update README: config present — fix mdl link

  • config/.mdlrc.rb — Found (no action needed).
  • README.md (line 52): replace the DavidAnson/markdownlint (Node) link with markdownlint/markdownlint (the Ruby mdl repo) to avoid confusion.

Comment thread _includes/head.html Outdated
Comment thread AIPs/aip-2.md
Comment thread AIPs/aip-2.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (1)
AIPs/aip-2.md (1)

6-6: Automerge policy: Author header must include username/email in angle brackets

Current value won’t pass the bot check. Use <@username> or your public GitHub email in <...>.

-author: Javad Rajabzadeh (@ja7ad)
+author: Javad Rajabzadeh <@ja7ad>
🧹 Nitpick comments (4)
_includes/head.html (2)

15-15: Use rel="icon" (drop “alternate”) for broader compatibility

rel="alternate icon" is legacy; simplify to rel="icon".

-  <link rel="alternate icon" type="image/x-icon" href="{{ '/assets/favicons/favicon.ico' | relative_url }}">
+  <link rel="icon" type="image/x-icon" href="{{ '/assets/favicons/favicon.ico' | relative_url }}">

12-16: Optional: add Safari pinned tab (mask-icon) back

If you want pinned tab support in Safari, restore mask-icon.

   <link rel="manifest" href="{{ '/assets/favicons/site.webmanifest' | relative_url }}">
+  <link rel="mask-icon" href="{{ '/assets/favicons/safari-pinned-tab.svg' | relative_url }}" color="#5bbad5">
AIPs/aip-2.md (2)

52-55: Clarify α’s applicability

As written, “minimum reward floor” suggests everyone gets the floor. Clarify that α applies only when eligible (i.e., not excluded).

-   - Where:
-      - $α$ = fixed proportion (e.g., 0.5) ensuring a minimum reward floor.
-      - $score$ = availability score of the validator (0.0 ≤ score ≤ 1.0).
+   - Where:
+     - $α$ = fixed proportion (e.g., 0.5) ensuring a minimum reward floor for eligible validators ($score \\ge \\tau$).
+     - $score$ = availability score of the validator ($0.0 \\le score \\le 1.0$).

36-36: markdownlint (MD007): fix list indentation to 2-space steps (and 4 for sub-items)

Adjust indentation to satisfy the project’s mdl config.

Example fixes:

-   - A value between $0.0$ and $1.0$ representing the validator's recent
+  - A value between $0.0$ and $1.0$ representing the validator's recent
@@
-      - $α$ = fixed proportion (e.g., 0.5) ensuring a minimum reward floor.
-      - $score$ = availability score of the validator (0.0 ≤ score ≤ 1.0).
+    - $α$ = fixed proportion (e.g., 0.5) ensuring a minimum reward floor for eligible validators.
+    - $score$ = availability score of the validator (0.0 ≤ score ≤ 1.0).
@@
-   - $score = 1.0$ → $reward = 0.7 AUM$
+  - $score = 1.0$ → $reward = 0.7 AUM$

Run markdownlint to catch the rest.

Also applies to: 38-38, 40-40, 43-43, 46-46, 52-52, 53-53, 54-54, 57-57, 58-58, 59-59, 60-60

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • MCP integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 7ede206 and 10ff3d5.

📒 Files selected for processing (2)
  • AIPs/aip-2.md (1 hunks)
  • _includes/head.html (1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
AIPs/aip-2.md

36-36: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


38-38: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


40-40: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


43-43: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


46-46: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


52-52: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


53-53: Unordered list indentation
Expected: 4; Actual: 6

(MD007, ul-indent)


54-54: Unordered list indentation
Expected: 4; Actual: 6

(MD007, ul-indent)


57-57: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


58-58: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


59-59: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


60-60: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)

🔇 Additional comments (1)
_includes/head.html (1)

12-16: Good fix: favicon paths now robust via relative_url

Using Jekyll’s relative_url and adding SVG/ICO variants resolves nested-path 404s. Nice.

Comment thread _includes/head.html Outdated
Comment thread AIPs/aip-2.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
AIPs/aip-2.md (1)

6-6: Automerge blocker: Author header must include username/email in angle brackets

Per the repo’s automerge policy, include your GitHub handle or your public email in < >. Example fix:

-author: Javad Rajabzadeh (@ja7ad)
+author: Javad Rajabzadeh <@ja7ad>
🧹 Nitpick comments (7)
AIPs/aip-2.md (7)

35-41: Fix list indentation (MD007) and reference τ consistently

  • Align sub-list items to 2-space indent to satisfy markdownlint.
  • Use τ in both bullets to avoid mixing τ with a raw numeric.
- - **Availability Score**:
-   - A value between $0.0$ and $1.0$ representing the validator's recent
-    performance and uptime.
-   - Scores below $\tau = \frac{2}{3}\;(\approx 0.666667)$ result in temporary
-     exclusion from the committee (no rewards).
-   - Scores $≥ 0.666667$ are eligible for scaled rewards.
+- **Availability Score**:
+  - A value between $0.0$ and $1.0$ representing the validator's recent performance and uptime.
+  - Define $\tau = \tfrac{2}{3}\;(\approx 0.666667)$.
+  - Scores $< \tau$ result in temporary exclusion from the committee (no rewards).
+  - Scores $\ge \tau$ are eligible for scaled rewards.

43-55: Normalize math notation and fix sub-list indentation (MD007)

  • Keep 2-space indents.
  • Use LaTeX symbols consistently.
  • Clarify the floor applies to eligible validators.
- - **Reward Scaling Formula**:
-   - Let $base\\_reward$ be the validator's share of the block reward (e.g., if
-    the protocol allocates 70% of each block reward to validators and 30% to
-    the foundation, then $base\\_reward$ = 0.7 AUM).
-   - The adjusted reward is calculated as:
-
-      $$
-      reward = base\\_reward × (α + (1 − α) × score)
-      $$
-
-   - Where:
-      - $α$ = fixed proportion (e.g., 0.5) ensuring a minimum reward floor.
-      - $score$ = availability score of the validator (0.0 ≤ score ≤ 1.0).
+- **Reward Scaling Formula**:
+  - Let $base\\_reward$ be the validator's share of the block reward (e.g., if the protocol allocates 70% of each block reward to validators and 30% to the foundation, then $base\\_reward = 0.7$ AUM).
+  - The adjusted reward is calculated as:
+
+    $$
+    reward = base\\_reward \\times (\\alpha + (1 - \\alpha) \\times score)
+    $$
+
+  - Where:
+    - $\\alpha$ = fixed proportion (e.g., 0.5) ensuring a minimum reward floor for eligible validators ($score \\ge \\tau$).
+    - $score$ = availability score of the validator ($0.0 \\le score \\le 1.0$).

56-61: Add boundary example at τ and fix list indentation (MD007)

- - **Examples** (with $base\\_reward = 0.7$, $α = 0.5$):
-   - $score = 1.0$ → $reward = 0.7 AUM$
-   - $score = 0.98$ → $reward = 0.693 AUM$
-   - $score = 0.6$ (below $\tau$) → excluded → $reward = 0$
-   - $score = 0.0$ (below $\tau$) → excluded → $reward = 0$
+- **Examples** (with $base\\_reward = 0.7$, $\\alpha = 0.5$):
+  - $score = 1.0$ → $reward = 0.7\\,\\mathrm{AUM}$
+  - $score = 0.98$ → $reward \\approx 0.693\\,\\mathrm{AUM}$
+  - $score = 0.666667 \\approx \\tau$ → $reward \\approx 0.5833\\,\\mathrm{AUM}$
+  - $score = 0.6$ (below $\\tau$) → excluded → $reward = 0$
+  - $score = 0.0$ (below $\\tau$) → excluded → $reward = 0$

73-78: Mirror the τ boundary in Test Cases and keep consistent notation

-- Validator $score = 1.0$, $reward = 0.7$
-- Validator $score = 0.98$, $reward ≈ 0.693$
-- Validator $score = 0.6$ (below $\tau$), $reward = 0$
-- Validator $score = 0.0$ (below $\tau$), $reward = 0$
-- Validator $score < 0.666667$ and excluded from committee → $reward = 0$
+- Validator $score = 1.0$, $reward = 0.7$
+- Validator $score = 0.98$, $reward \\approx 0.693$
+- Validator $score = 0.666667 \\approx \\tau$, $reward \\approx 0.5833$
+- Validator $score = 0.6$ (below $\\tau$), $reward = 0$
+- Validator $score = 0.0$ (below $\\tau$), $reward = 0$
+- Validator $score < 0.666667$ and excluded from committee → $reward = 0$

86-87: Reword “Fairness” to reflect exclusion below τ

Current text suggests avoiding harsh penalties, but below-τ exclusion is zero-reward. Suggest:

- - **Fairness**: Ensures consistent uptime is rewarded but prevents harsh
-  penalties that could discourage participation.
+ - **Fairness**: Rewards consistent uptime; below-$\\tau$ exclusion should include clear re-entry rules to avoid overly harsh, prolonged penalties.

45-46: Define “AUM” on first use

Readers may not know the unit. Add a brief parenthetical definition at first mention.


48-51: Math rendering check

Ensure the site/build pipeline renders LaTeX ($$ ... $$) and inline math. If not, provide an ASCII fallback formula in a code block.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • MCP integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 10ff3d5 and 031f2f2.

📒 Files selected for processing (1)
  • AIPs/aip-2.md (1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
AIPs/aip-2.md

36-36: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


38-38: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


40-40: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


43-43: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


46-46: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


52-52: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


53-53: Unordered list indentation
Expected: 4; Actual: 6

(MD007, ul-indent)


54-54: Unordered list indentation
Expected: 4; Actual: 6

(MD007, ul-indent)


57-57: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


58-58: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


59-59: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


60-60: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)

🔇 Additional comments (1)
AIPs/aip-2.md (1)

10-11: Confirm discussion reference

Please verify that discussion-no: 3 points to the intended public discussion thread/issue and matches project conventions.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
AIPs/aip-2.md (1)

6-6: Automerge blocker: Author header must contain username/email in angle brackets

Per the repo’s automerge policy, wrap the GitHub handle or public email in < >. This was flagged earlier and still needs updating.

-author: Javad Rajabzadeh (@ja7ad)
+author: Javad Rajabzadeh <@ja7ad>
🧹 Nitpick comments (5)
AIPs/aip-2.md (2)

4-5: Make description a folded scalar to avoid YAML/front-matter line-break quirks

Ensures a single-line meta description in templates.

-description: Adjust validator rewards proportionally to their availability score to
-  incentivize consistent uptime and reliable participation.
+description: >-
+  Adjust validator rewards proportionally to their availability score to incentivize
+  consistent uptime and reliable participation.

41-54: Define the reward unit once (what is “AUM”?)

If “AUM” is a chain-specific unit, add a short parenthetical or footnote defining it on first use to avoid ambiguity.

_includes/head.html (3)

7-7: Use rel="icon" instead of "alternate icon" for broader UA support

Minor compatibility/consistency tweak.

-  <link rel="alternate icon" type="image/x-icon" href="{{ '/assets/favicons/favicon.ico' | relative_url }}">
+  <link rel="icon" type="image/x-icon" href="{{ '/assets/favicons/favicon.ico' | relative_url }}">

4-9: Make theme-color/msapplication meta unconditional (match favicon placement)

They’re currently only in the else branch, so AIP pages miss them. Move near the favicon block and remove from else.

   <meta name="viewport" content="width=device-width, initial-scale=1" />
+  <meta name="msapplication-TileColor" content="#da532c">
+  <meta name="theme-color" content="#ffffff">
@@
-  <meta name="msapplication-TileColor" content="#da532c">
-  <meta name="theme-color" content="#ffffff">

Also applies to: 18-19


8-8: Optional: add Safari pinned tab icon if asset exists

Improves macOS/iOS Safari integration.

   <link rel="manifest" href="{{ '/assets/favicons/site.webmanifest' | relative_url }}">
+  <link rel="mask-icon" href="{{ '/assets/favicons/safari-pinned-tab.svg' | relative_url }}" color="#5bbad5">
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • MCP integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 031f2f2 and dca99dd.

📒 Files selected for processing (2)
  • AIPs/aip-2.md (1 hunks)
  • _includes/head.html (1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
AIPs/aip-2.md

36-36: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


37-37: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


38-38: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


39-39: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


42-42: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


45-45: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


51-51: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


52-52: Unordered list indentation
Expected: 4; Actual: 6

(MD007, ul-indent)


53-53: Unordered list indentation
Expected: 4; Actual: 6

(MD007, ul-indent)


56-56: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


57-57: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


58-58: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


59-59: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


60-60: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)

🔇 Additional comments (2)
AIPs/aip-2.md (1)

68-70: Re-check “No backward compatibility issues” claim

The spec introduces temporary committee exclusion for scores < τ. If committee membership logic changes, this can be consensus-affecting. Confirm whether exclusion already exists and this AIP only changes reward scaling, or update this section to note consensus implications and rollout.

_includes/head.html (1)

4-9: Unconditional, root-relative favicons: LGTM

Using relative_url and moving the block above the layout conditional fixes broken paths on nested pages and ensures icons load everywhere.

Comment thread AIPs/aip-2.md
@aerium-admin aerium-admin merged commit 356cd42 into main Sep 13, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants