You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This directory contains the implementation of the MRC settlement smart contract. To test the contract, run:
4
4
@@ -8,9 +8,12 @@ forge test
8
8
9
9
There is a long-running test covering over 50 epochs. It will likely take a few seconds to run.
10
10
11
-
# Implementation
12
-
## Description
11
+
## Implementation
12
+
13
+
### Description
14
+
13
15
For a given block height, MCR selects the earliest block commitment that matches the supermajority of stake for a given epoch by:
16
+
14
17
1. Fixing the stake parameters for the epoch; all stake changes apply to the next epoch.
15
18
2. Tracking commitments for each block height until one exceeds the supermajority of stake.
16
19
@@ -20,14 +23,14 @@ For a given block height, MCR selects the earliest block commitment that matches
20
23
21
24
The stake is fixed for an epoch, so only commitments for a specific block height are considered, allowing for a straightforward proof.
22
25
23
-
**Commitment**. Let $v: C \to V$ map a commitment to its validator, where $C$ represent all possible commitments and $V$ is the set of validators. Since commitments are ordered by L1 in the L1-blocks, let $C'$ be an ordered subset of $C$ with $k$ elements (i.e. up to the $k$-th commitment).
26
+
**Commitment**. Let $v: C \to V$ map a commitment to its validator, where $C$ represent all possible commitments and $V$ is the set of validators. Since commitments are ordered by L1 in the L1-blocks, let $C'$ be an ordered subset of $C$ with $k$ elements (i.e. up to the $k$-th commitment).
24
27
25
28
**Stake**. Let $s: V \to \mathbb{N}$ map a validator to their stake and $S(C',i) = \sum_{j = 1}^{i} s(v(c_j))$ the cumulative stake up to the $i$-th commitment. $S$ is non-decreasing as $S(C',i) = S(C',i - 1) + s(v(c_i))$.
If $S(C', i)$ satisfies the condition, and $S(C',i-1)$ does not, then $c_i$ is returned by MCR. Due to the non-decreasing nature of $S$ with $i$, $c_i$ is the earliest commitment that can be returned.
36
+
If $S(C', i)$ satisfies the condition, and $S(C',i-1)$ does not, then $c_i$ is returned by MCR. Due to the non-decreasing nature of $S$ with $i$, $c_i$ is the earliest commitment that can be returned.
0 commit comments