Skip to content

Commit ca76f89

Browse files
authored
Merge branch 'dev' into feat/prooftra
2 parents 88d3349 + 865e723 commit ca76f89

File tree

3 files changed

+75
-8
lines changed

3 files changed

+75
-8
lines changed

.github/workflows/certora-prover.yml

Lines changed: 65 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,64 @@
1-
name: Certora Prover Workflow
1+
name: Certora
22

33
on:
4-
push:
5-
branches:
6-
- dev
4+
# Run when PRs from feat/* branches are merged into dev
75
pull_request:
6+
types: [closed]
87
branches:
98
- dev
9+
10+
# Run on any pushes to certora/* branches
11+
push:
12+
branches:
13+
- 'certora/**'
14+
15+
# Biweekly schedule (1st and 15th of each month at midnight UTC)
16+
schedule:
17+
- cron: '0 0 1,15 * *'
18+
19+
# Manual trigger
1020
workflow_dispatch:
1121

1222
jobs:
23+
# First job: Compile the contracts for Certora verification
1324
compile:
14-
runs-on: ubuntu-latest
25+
name: Compile
26+
# Run if it meets one of these conditions:
27+
# 1. It's a merged PR from a feat/* branch to dev
28+
# 2. It's a push to a certora/* branch
29+
# 3. It's a scheduled run
30+
# 4. It's a manually triggered run
31+
if: >
32+
(github.event_name == 'pull_request' &&
33+
github.event.pull_request.merged == true &&
34+
startsWith(github.head_ref, 'feat/')) ||
35+
(github.event_name == 'push' &&
36+
startsWith(github.ref, 'refs/heads/certora/')) ||
37+
github.event_name == 'schedule' ||
38+
github.event_name == 'workflow_dispatch'
39+
runs-on: protocol-x64-16core
1540
steps:
41+
# Checkout the repository with submodules
1642
- uses: actions/checkout@v4
1743
with:
1844
submodules: recursive
45+
# Use dev branch for scheduled runs, otherwise use the branch that triggered the workflow
46+
ref: ${{ github.event_name == 'schedule' && 'dev' || github.ref }}
47+
48+
# Install the Foundry toolchain
1949
- name: Install Foundry
2050
uses: foundry-rs/foundry-toolchain@v1
2151
with:
2252
version: stable
53+
54+
# Install dependencies using Forge
2355
- name: Install forge dependencies
2456
run: forge install
57+
58+
# Run Certora compilation step only
2559
- uses: Certora/certora-run-action@v1
2660
with:
61+
# List of configuration files for different contracts to verify
2762
configurations: |-
2863
certora/confs/core/AllocationManager.conf
2964
certora/confs/core/AllocationManagerSanity.conf
@@ -38,25 +73,48 @@ jobs:
3873
solc-remove-version-prefix: "0."
3974
job-name: "Eigenlayer Contracts"
4075
certora-key: ${{ secrets.CERTORAKEY }}
76+
# Only compile, don't run verification yet
4177
compilation-steps-only: true
4278
env:
4379
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4480

81+
# Second job: Run the actual verification after compilation succeeds
4582
verify:
46-
runs-on: ubuntu-latest
83+
name: Verify
84+
runs-on: protocol-x64-16core
85+
# This job depends on the compile job
4786
needs: compile
87+
# Same conditions as the compile job
88+
if: >
89+
(github.event_name == 'pull_request' &&
90+
github.event.pull_request.merged == true &&
91+
startsWith(github.head_ref, 'feat/')) ||
92+
(github.event_name == 'push' &&
93+
startsWith(github.ref, 'refs/heads/certora/')) ||
94+
github.event_name == 'schedule' ||
95+
github.event_name == 'workflow_dispatch'
4896
steps:
97+
# Checkout the repository with submodules
4998
- uses: actions/checkout@v4
5099
with:
51100
submodules: recursive
101+
# Use dev branch for scheduled runs, otherwise use the branch that triggered the workflow
102+
ref: ${{ github.event_name == 'schedule' && 'dev' || github.ref }}
103+
104+
# Install the Foundry toolchain.
52105
- name: Install Foundry
53106
uses: foundry-rs/foundry-toolchain@v1
54107
with:
55-
version: nightly
108+
version: stable
109+
110+
# Install dependencies using Forge
56111
- name: Install forge dependencies
57112
run: forge install
113+
114+
# Run Certora verification with the same configurations
58115
- uses: Certora/certora-run-action@v1
59116
with:
117+
# List of configuration files for different contracts to verify
60118
configurations: |-
61119
certora/confs/core/AllocationManager.conf
62120
certora/confs/core/AllocationManagerSanity.conf

docs/core/AllocationManager.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,13 @@ Given an `operator` and an `Allocation` from a `strategy` to an AVS's `OperatorS
529529

530530
If ALL of these are true, the `AllocationManager` will allow the AVS to slash the `operator's` `Allocation`.
531531

532+
#### Evaluating How Much of the Allocation is "Slashable"
533+
534+
The `getMinimumSlashableStake` calculates the minimum amount of stake that will be slashable at a specified future block. This computation accounts for each operator’s allocated stake from different strategies within an operator set. The function considers pending allocation changes that could reduce the slashable stake over time, ensuring a minimum guaranteed value. Because this is a forecast, the slashable stake at any given moment is a discrete value, but when looking ahead to a future block, the function provides the lowest possible amount, factoring in any planned allocation adjustments that will take effect within the specified timeframe.
535+
536+
Please see [IAllocationManager.sol:getMinimumSlashableStake](https://github.com/Layr-Labs/eigenlayer-contracts/blob/dev/src/contracts/interfaces/IAllocationManager.sol#L577) for more detail.
537+
538+
532539
#### `modifyAllocations`
533540

534541
```solidity

docs/core/RewardsCoordinator.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ The typical user flow is as follows:
2626

2727
This entire flow will repeat periodically as AVSs submit rewards submissions, `DistributionRoots` are submitted, and Stakers/Operators claim their accumulated earnings. Note that `DistributionRoots` contain *cumulative earnings*, meaning Stakers/Operators aren't required to claim against every root - simply claiming against the most recent root will claim anything not yet claimed.
2828

29+
**NOTE: Use caution when using reward tokens that do not strictly conform to ERC20 standards. Please DYOR if your token falls outside of ERC20 norms.** Specific things to look out for include (but are not limited to): exotic rebasing tokens, fee-on-transfer tokens, tokens that support reentrant behavior (like ERC-777), and other nonstandard ERC20 derivatives.
30+
2931
#### High-level Concepts
3032

3133
This document is organized according to the following themes (click each to be taken to the relevant section):
@@ -612,4 +614,4 @@ The rewards merkle tree is structured in the diagram below:
612614

613615
Rewards are calculated via an off-chain data pipeline. The pipeline takes snapshots of core contract state at the `SNAPSHOT_CADENCE`, currently set to once per day. It then combines these snapshots with any active rewards to calculate what the single daily reward of an earner is. Every `CALCULATION_INTERVAL_SECONDS` rewards are accumulated up to `lastRewardsTimestamp + CALCULATION_INTERVAL_SECONDS` and posted on-chain by the entity with the `rewardsUpdater` role.
614616

615-
`MAX_REWARDS_AMOUNT` is set to `1e38-1` given the precision bounds of the off-chain pipeline. An in-depth overview of the off-chain calculation can be found [here](https://hackmd.io/Fmjcckn1RoivWpPLRAPwBw)
617+
`MAX_REWARDS_AMOUNT` is set to `1e38-1` given the precision bounds of the off-chain pipeline. An in-depth overview of the off-chain calculation can be found [here](https://github.com/Layr-Labs/sidecar/blob/master/docs/docs/sidecar/rewards/calculation.md)

0 commit comments

Comments
 (0)