-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #574 from lidofinance/feat/oracle-v5
[EPIC] Oracle V5 (Pectra Duck)
- Loading branch information
Showing
99 changed files
with
4,531 additions
and
3,163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Mainnet Fork Tests | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
- edited | ||
- closed | ||
branches: | ||
- main | ||
- develop | ||
paths: | ||
- "src/**" | ||
|
||
permissions: | ||
contents: read | ||
security-events: write | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.12 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.12" | ||
|
||
- name: Setup poetry | ||
run: > | ||
curl -sSL https://install.python-poetry.org | python - && | ||
echo "$POETRY_HOME/bin" >> "$GITHUB_PATH" | ||
env: | ||
POETRY_HOME: "/opt/poetry" | ||
POETRY_VERSION: 1.3.2 | ||
|
||
- name: Install Python dependencies | ||
run: | | ||
poetry install --no-interaction --with=dev | ||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
|
||
- name: Mainnet Fork Tests | ||
run: poetry run pytest -m 'fork' -n auto tests | ||
env: | ||
EXECUTION_CLIENT_URI: ${{ secrets.EXECUTION_CLIENT_URI }} | ||
CONSENSUS_CLIENT_URI: ${{ secrets.CONSENSUS_CLIENT_URI }} | ||
KEYS_API_URI: ${{ secrets.KEYS_API_URI }} | ||
LIDO_LOCATOR_ADDRESS: "0xC1d0b3DE6792Bf6b4b37EccdcC24e45978Cfd2Eb" | ||
CSM_MODULE_ADDRESS: "0xdA7dE2ECdDfccC6c3AF10108Db212ACBBf9EA83F" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,46 @@ | ||
from src.types import Gwei, SlotNumber | ||
|
||
# https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#misc | ||
FAR_FUTURE_EPOCH = 2 ** 64 - 1 | ||
GENESIS_SLOT = SlotNumber(0) | ||
FAR_FUTURE_EPOCH = 2**64 - 1 | ||
# https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#time-parameters-1 | ||
MIN_VALIDATOR_WITHDRAWABILITY_DELAY = 2**8 | ||
SHARD_COMMITTEE_PERIOD = 256 | ||
SHARD_COMMITTEE_PERIOD = 2**8 | ||
MAX_SEED_LOOKAHEAD = 4 | ||
# https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#state-list-lengths | ||
EPOCHS_PER_SLASHINGS_VECTOR = 2**13 | ||
# https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#rewards-and-penalties | ||
PROPORTIONAL_SLASHING_MULTIPLIER_BELLATRIX = 3 | ||
# https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#gwei-values | ||
EFFECTIVE_BALANCE_INCREMENT = 2 ** 0 * 10 ** 9 | ||
MAX_EFFECTIVE_BALANCE = 32 * 10 ** 9 | ||
EFFECTIVE_BALANCE_INCREMENT = Gwei(2**0 * 10**9) | ||
MAX_EFFECTIVE_BALANCE = Gwei(32 * 10**9) | ||
# https://github.com/ethereum/consensus-specs/blob/dev/specs/electra/beacon-chain.md#gwei-values | ||
MAX_EFFECTIVE_BALANCE_ELECTRA = Gwei(2**11 * 10**9) | ||
MIN_ACTIVATION_BALANCE = Gwei(2**5 * 10**9) | ||
# https://github.com/ethereum/consensus-specs/blob/dev/specs/capella/beacon-chain.md#execution | ||
MAX_WITHDRAWALS_PER_PAYLOAD = 2 ** 4 | ||
MAX_WITHDRAWALS_PER_PAYLOAD = 2**4 | ||
# https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#withdrawal-prefixes | ||
ETH1_ADDRESS_WITHDRAWAL_PREFIX = '0x01' | ||
# https://github.com/ethereum/consensus-specs/blob/dev/specs/electra/beacon-chain.md#withdrawal-prefixes | ||
COMPOUNDING_WITHDRAWAL_PREFIX = '0x02' | ||
# https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#validator-cycle | ||
MIN_PER_EPOCH_CHURN_LIMIT = 2 ** 2 | ||
CHURN_LIMIT_QUOTIENT = 2 ** 16 | ||
MIN_PER_EPOCH_CHURN_LIMIT = 2**2 | ||
CHURN_LIMIT_QUOTIENT = 2**16 | ||
# https://github.com/ethereum/consensus-specs/blob/dev/specs/electra/beacon-chain.md#validator-cycle | ||
MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA = Gwei(2**7 * 10**9) | ||
MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT = Gwei(2**8 * 10**9) | ||
# https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#time-parameters | ||
SLOTS_PER_HISTORICAL_ROOT = 8192 | ||
SLOTS_PER_HISTORICAL_ROOT = 2**13 # 8192 | ||
|
||
# Local constants | ||
GWEI_TO_WEI = 10 ** 9 | ||
SHARE_RATE_PRECISION_E27 = 10 ** 27 | ||
# https://github.com/ethereum/consensus-specs/blob/dev/specs/electra/beacon-chain.md#withdrawals-processing | ||
MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP = 2**3 | ||
|
||
# Lido contracts constants | ||
LIDO_DEPOSIT_AMOUNT = MIN_ACTIVATION_BALANCE | ||
SHARE_RATE_PRECISION_E27 = 10**27 | ||
TOTAL_BASIS_POINTS = 10000 | ||
|
||
# Local constants | ||
GWEI_TO_WEI = 10**9 | ||
MAX_BLOCK_GAS_LIMIT = 30_000_000 | ||
|
||
UINT64_MAX = 2 ** 64 - 1 | ||
UINT64_MAX = 2**64 - 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.