Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(contracts): new registry (V1) #202

Merged
merged 248 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
248 commits
Select commit Hold shift + click to select a range
2d28c02
feat(registry): stub initial rewrite: register and deposit
merklefruit Aug 23, 2024
e7d994e
chore: refactor storage
merklefruit Aug 23, 2024
3658692
wip: stash first tests
merklefruit Aug 26, 2024
a127ff3
forge install: core
merklefruit Aug 26, 2024
b49f46d
chore: remappings
merklefruit Aug 26, 2024
28ef162
feat: added BoltValidators with prover
merklefruit Aug 26, 2024
568b220
chore: contracts ci
merklefruit Aug 26, 2024
a8703fa
feat: added boltManager initial version
merklefruit Aug 28, 2024
f251fa2
feat: deprecate old contracts, add docs, new bolt manager fns
merklefruit Aug 29, 2024
db2ed31
chore: removed deprecated contracts, fixed compiler
merklefruit Aug 29, 2024
8744b3d
chore: solc version bump
merklefruit Aug 29, 2024
eb37947
chore: emit event
merklefruit Aug 29, 2024
c280ca7
chore: solc version pin
merklefruit Aug 29, 2024
2d2b519
feat(registry): unsafe registration
merklefruit Sep 2, 2024
c9d740c
chore: patch build
merklefruit Sep 2, 2024
4607997
chore: add unsafe access control
merklefruit Sep 2, 2024
92a9c29
chore: unit test
merklefruit Sep 3, 2024
1166511
feat: test fixture for symbiotic core
merklefruit Sep 3, 2024
5753835
wip: more boltmanager tests
merklefruit Sep 4, 2024
41129dc
wip: implicit conversion error
merklefruit Sep 4, 2024
cbc577c
chore: nits
merklefruit Sep 4, 2024
c37d709
chore: stash
merklefruit Sep 4, 2024
6ea308e
chore: update symbiotic core
merklefruit Sep 4, 2024
e92fac7
feat: add mock collateral
merklefruit Sep 4, 2024
88a8e5d
chore: add docs
merklefruit Sep 4, 2024
87ffcb6
chore: update tests
merklefruit Sep 5, 2024
2799e6a
feat: deposit in bolt network test
merklefruit Sep 6, 2024
5eedd67
chore: finish deposit test
merklefruit Sep 6, 2024
a21486c
feat: fetch validator status with stake from manager
merklefruit Sep 6, 2024
1d7b646
feat: add collateral whitelist logic
merklefruit Sep 6, 2024
1e341de
chore: compile via-ir in ci
merklefruit Sep 6, 2024
01194e0
feat: enhanced docs
merklefruit Sep 6, 2024
7c1a4a9
chore: updated interface
merklefruit Sep 6, 2024
57c0b72
feat: add lookahead test
merklefruit Sep 9, 2024
ed06b9d
fix: read staked balance in tests
merklefruit Sep 9, 2024
1c6badb
feat: add basic pro-rata slashing function
merklefruit Sep 9, 2024
2df8680
chore: add comment
merklefruit Sep 9, 2024
4811e09
chore: rm simplecollateral
merklefruit Sep 9, 2024
891ea9d
feat: added validators tests and comments
merklefruit Sep 9, 2024
614c036
feat: fmt, add slashing assertion
merklefruit Sep 9, 2024
ff5b569
fix(contracts): compile with via-ir
mempirate Sep 10, 2024
1940c76
feat(contracts): add unsafe batch registration
mempirate Sep 10, 2024
6826df5
forge install: eigenlayer-contracts
thedevbirb Sep 9, 2024
bdf821c
chore(contracts): @openzeppelin -> lib/openzeppelin-contracts
thedevbirb Sep 9, 2024
d677216
chore(contracts): move remappings.txt to foundry.toml, use remappings…
thedevbirb Sep 9, 2024
f0bd7f9
feat(contracts): eigenlayer integration stub
thedevbirb Sep 9, 2024
af4591b
chore(contracts): copy EigenLayerDeployer into our project + some fixes
thedevbirb Sep 9, 2024
c77065a
test(contracts): el -- mint weth with staker address
thedevbirb Sep 9, 2024
0ecc67a
chore(contract): updateEigenLayerAVSMetadataURI
thedevbirb Sep 10, 2024
d485d72
fix(contracts): rename eigenlayer fixture + little changes
thedevbirb Sep 10, 2024
72d08f6
test(contracts): eigenlayer integration
thedevbirb Sep 10, 2024
3c64886
feat(contracts): more in-depth integration of eigenlayer like with sy…
thedevbirb Sep 10, 2024
5677632
fix(contracts): ignore warning from eigenlayer dep
thedevbirb Sep 11, 2024
cb8bd3a
feat(contracts): more in-depth integration of eigenlayer like symbiot…
thedevbirb Sep 11, 2024
514a897
fix(contracts): test + eigenlayer logic
thedevbirb Sep 11, 2024
0f8826f
fix(contracts): duplicate identifier
thedevbirb Sep 11, 2024
789d34c
chore(contracts): align interfaces, fix typo
thedevbirb Sep 11, 2024
5c5b304
chore(contracts): forge fmt
thedevbirb Sep 11, 2024
f9f9785
chore(contracts): add forge fmt --check to ci
thedevbirb Sep 12, 2024
90e2b16
test(contracts): more on EL integration
thedevbirb Sep 12, 2024
64b809c
chore(contracts): forge fmt
thedevbirb Sep 12, 2024
73ee3f8
chore(contracts): test file rename
thedevbirb Sep 12, 2024
5fba799
chore(contracts): remove duplicate revert
thedevbirb Sep 13, 2024
2abadba
chore(contracts): forge fmt
thedevbirb Sep 13, 2024
e939301
feat(sidecar): constraints client init
namn-grg Sep 5, 2024
114ccb1
chore(sidecar): rename mevboost > constraint_client
namn-grg Sep 5, 2024
0601582
chore(sidecar): rename to constraints client, remove digest
namn-grg Sep 6, 2024
ea37421
chore: solve conflicts
merklefruit Sep 18, 2024
8f6bf3e
chore: solve upstream conflicts
merklefruit Sep 18, 2024
4cd3bab
docs(contracts): added EigenLayer integration in README
thedevbirb Sep 17, 2024
f2b3a1f
docs(contracts): better EL explanation
thedevbirb Sep 17, 2024
e786c0e
docs(contracts): better readme for el
thedevbirb Sep 19, 2024
1bf5389
test
thedevbirb Sep 20, 2024
e14caf0
docs(contracts): el integration once again
thedevbirb Sep 20, 2024
11fd740
docs(contracts): feedback
thedevbirb Sep 23, 2024
defd207
docs(contracts): readme EL again
thedevbirb Sep 24, 2024
94ee1e2
Merge pull request #232 from chainbound/lore/docs/eigenlayer-integration
thedevbirb Sep 25, 2024
30f6d2f
test(contracts): more on EL integration
thedevbirb Sep 12, 2024
5147bdf
chore(contracts): remove duplicate revert
thedevbirb Sep 13, 2024
9fd4914
feat(contracts): IBoltMiddleware interface
thedevbirb Sep 19, 2024
5444474
feat(contracts): BoltEigenLayerMiddleware.sol stub
thedevbirb Sep 19, 2024
40770a8
feat(contracts): middleware name hash identifier
thedevbirb Sep 20, 2024
8ae639e
feat(contracts): enumerable map for middleware contracts
thedevbirb Sep 20, 2024
eca5190
chore(contracts): remove EL functions from BoltManager, they've been …
thedevbirb Sep 20, 2024
98530a3
chore(contracts): rename + modify deployer contract
thedevbirb Sep 20, 2024
8f61b7f
fix(contracts): make tests compile
thedevbirb Sep 20, 2024
a8a6502
test(contracts): eigenlayer middleware working
thedevbirb Sep 23, 2024
a7263e2
chore(contracts): function docs, remove some Symbiotic constants insi…
thedevbirb Sep 23, 2024
23ca744
chore(contract): nameHash -> NAME_HASH in interface too
thedevbirb Sep 23, 2024
a83a54c
chore(contracts): EL middleware fmt
thedevbirb Sep 23, 2024
e838b95
feat(contracts): BoltSymbioticMiddleware.sol
thedevbirb Sep 23, 2024
a0acaba
chore(contracts): BoltManager.sol remove old symbiotic functionalitie…
thedevbirb Sep 23, 2024
0368a31
fix(contracts): deploy script after symbiotic middleware
thedevbirb Sep 23, 2024
94b5d22
fix(contracts): Symbiotic/EL tests after middleware migration
thedevbirb Sep 23, 2024
b7b517a
chore(contracts): README
thedevbirb Sep 23, 2024
ec916b8
chore(contracts): remove unused constant from boltmanager
thedevbirb Sep 23, 2024
827d2a2
Update bolt-contracts/README.md
thedevbirb Sep 23, 2024
a3f47c5
fix(contracts): remove useless type casting
thedevbirb Sep 23, 2024
9dd6f12
chore(contracts): deploy log
thedevbirb Sep 23, 2024
27ac4ce
chore(contracts): restaking protocols getter; function docs
thedevbirb Sep 23, 2024
4077501
refactor!(contracts): remove everything extra from BoltManager
thedevbirb Sep 24, 2024
e9c4418
chore(contracts): remove some symbiotic prefixes in symbiotic middleware
thedevbirb Sep 24, 2024
5fc293c
chore(contracts): middleware now hold reference to BoltManager instea…
thedevbirb Sep 30, 2024
18f2554
chore(contracts): restore IBoltManager.sol interface
thedevbirb Sep 30, 2024
2cd43db
Merge pull request #235 from chainbound/lore/feat/middleware-interface
merklefruit Sep 30, 2024
0280706
wip: challenge proof components poc
merklefruit Sep 11, 2024
c0e47a8
feat: working header proof test
merklefruit Sep 11, 2024
91b2fe3
chore: small changes
merklefruit Sep 11, 2024
2c0239f
feat: working header + account proving. wip: transaction inclusion
merklefruit Sep 11, 2024
cf98dcd
chore: cleanup
merklefruit Sep 11, 2024
54ff8d2
chore: cleanup
merklefruit Sep 12, 2024
f25a714
fix: tx inclusion proof test
merklefruit Sep 12, 2024
8d540b7
chore: wip
merklefruit Sep 15, 2024
d276656
feat: open challenge logic
merklefruit Sep 16, 2024
aa75994
feat: stubbed resolution fns
merklefruit Sep 16, 2024
742372d
wip: rlp envelope decoding stub
merklefruit Sep 16, 2024
6ddef3d
feat: open challenge + commitment test
merklefruit Sep 17, 2024
91d87fb
feat: added tests
merklefruit Sep 17, 2024
3a89d63
feat: rlp decoding legacy + eip155 txs
merklefruit Sep 18, 2024
aa8decb
feat: cycle through all test cases
merklefruit Sep 18, 2024
8b77754
chore: added test
merklefruit Sep 18, 2024
4cea728
feat: added decoding support for 1559 and 4844
merklefruit Sep 18, 2024
3f5a7d4
fix: decode more test cases
merklefruit Sep 18, 2024
41b2113
feat: pass all test vectors
merklefruit Sep 18, 2024
d7bf8ef
chore: added docs
merklefruit Sep 18, 2024
89ee856
fix: forge remappings, minor warnings
merklefruit Sep 18, 2024
d4e287b
feat: update test vectors + decode eip4844 txs
merklefruit Sep 19, 2024
d0a21e9
feat: transfer bonds on challenge resolution
merklefruit Sep 19, 2024
977418d
chore: CEI pattern
merklefruit Sep 19, 2024
022c4aa
feat: first full resolution defense test
merklefruit Sep 20, 2024
86cf4d4
chore: fmt
merklefruit Sep 20, 2024
add1569
chore: fmt
merklefruit Sep 20, 2024
bbcfe26
chore: added docs
merklefruit Sep 23, 2024
59dac06
chore: updated readme, adjusted finalization window
merklefruit Sep 23, 2024
deaea6d
chore: rename target -> commitmentsigner
merklefruit Sep 23, 2024
ee63517
chore: rm relic-sdk dependency
merklefruit Sep 23, 2024
6b07c2c
fix: build
merklefruit Sep 23, 2024
80f84f5
feat: add gas snapshot
merklefruit Sep 24, 2024
82b4744
fix: accurate gas snapshot
merklefruit Sep 24, 2024
ed5c90c
chore(docs): rm broken list items
merklefruit Oct 1, 2024
05341d1
feat(registry): added max committed gas limit per validator
merklefruit Oct 1, 2024
ade1063
Merge pull request #251 from chainbound/nico/feat/max-gas-limit
merklefruit Oct 2, 2024
5685566
chore: rm unused interface, resolve warning
merklefruit Oct 2, 2024
b764a8e
Merge branch 'nico/feat/commitment-registry' of github.com:chainbound…
merklefruit Oct 2, 2024
7c8d63a
feat(contracts): consolidate EigenLayer registration, add deregister …
mempirate Oct 7, 2024
fd9c01e
feat(contracts): add opt-out, register operator RPC
mempirate Oct 8, 2024
c4a4135
fix(contracts): rpc memory -> calldata
mempirate Oct 8, 2024
f4992df
fix(contracts): tests + memory -> calldata
mempirate Oct 8, 2024
79f9db2
feat(contracts): return operator RPC in getProposerStatus
mempirate Oct 8, 2024
9c80589
feat(contracts): WIP update EigenLayer middleware, manager as entrypoint
mempirate Oct 8, 2024
95650a5
feat(contracts): WIP update Symbiotic middleware, tests failing
mempirate Oct 8, 2024
abdb69c
test(contracts): WIP on tests
mempirate Oct 9, 2024
eb1d9fe
test(contracts): WIP on tests
mempirate Oct 9, 2024
b06d368
chore: update gitignore
mempirate Oct 9, 2024
3c5b783
forge install: openzeppelin-contracts-upgradeable
mempirate Oct 9, 2024
b51aede
fix: rm
mempirate Oct 9, 2024
5e37a6b
chore(contracts): fix oz remappings
mempirate Oct 9, 2024
242df15
feat(contracts): implement UUPSProxy everywhere
mempirate Oct 9, 2024
14e8e06
fix(contracts): make tests work with initializers instead of construc…
mempirate Oct 9, 2024
07dc130
forge install: openzeppelin-foundry-upgrades
mempirate Oct 9, 2024
c217890
feat(contracts): import OZ Foundry Upgrades
mempirate Oct 9, 2024
f91a941
forge install: forge-std
mempirate Oct 9, 2024
eb5c531
feat(contracts): deploy with OZ Upgrades library
mempirate Oct 9, 2024
67df143
fix(contracts): fix tests, operator map bug
mempirate Oct 9, 2024
27fafed
fix: rm unused gitmodule
mempirate Oct 9, 2024
5fed1c4
fix(contracts): msg.sender check on registerOperator
mempirate Oct 10, 2024
16c6dcc
fix(contracts): add operator pause + unpause on EigenLayerMiddleware
mempirate Oct 10, 2024
52c6ef4
feat(contracts): add `getTotalStake` method on `BoltManager`
mempirate Oct 10, 2024
28148a8
feat(contracts): initial BoltParameters contract
mempirate Oct 11, 2024
c2a0732
feat(contracts): update deploy script with parameters
mempirate Oct 11, 2024
6da5685
fix(contracts): fix tests, integrate parameters
mempirate Oct 11, 2024
8db5ed9
feat(contracts/challenger): remove resolved challenges
mempirate Oct 11, 2024
83a4a75
feat: added stacked preconfs in the same slot by the same sender logic
merklefruit Sep 25, 2024
1829971
chore: addressed initial reviews
merklefruit Sep 25, 2024
3b4807e
fix: broken test
merklefruit Sep 25, 2024
16adcce
wip: test stacked transaction proofs
merklefruit Sep 25, 2024
f2179ee
wip: test stacked multiple commitments
merklefruit Sep 26, 2024
94c91e9
fix: stacked commitments test
merklefruit Sep 27, 2024
0b1645c
feat: update snapshot with 5 commitments
merklefruit Sep 27, 2024
05d70b5
chore: add tests, change challenge id formula
merklefruit Sep 27, 2024
e1d1792
chore: update docs
merklefruit Sep 27, 2024
e495312
Merge pull request #289 from chainbound/nico/feat/stacked-challenge
merklefruit Oct 11, 2024
b36c194
chore: lint
merklefruit Oct 11, 2024
0c40d4c
fix: merge conflict
mempirate Oct 14, 2024
4e1a461
fix: rm stale test
mempirate Oct 14, 2024
ff5cb6d
test(contracts): fix challenger tests
mempirate Oct 14, 2024
a5ae01a
test(contracts): fix challenger tests
mempirate Oct 14, 2024
960dfaa
Merge pull request #223 from chainbound/nico/feat/new-challenger
mempirate Oct 14, 2024
d497935
chore(testnets): rm logs
mempirate Oct 14, 2024
61ea21c
chore(testnets): rm logs
mempirate Oct 14, 2024
37e6c43
fix(contracts): use named error messages instead of require
mempirate Oct 14, 2024
33553f9
chore(contracts): nits
mempirate Oct 14, 2024
db0946a
feat: merge
mempirate Oct 14, 2024
147467c
feat(contracts): integrate challenger
mempirate Oct 14, 2024
d676783
feat(contracts): add storage gaps + documentation
mempirate Oct 14, 2024
f12505c
feat(contracts): integrate `BeaconChainUtils` in params + challenger,…
mempirate Oct 15, 2024
e2a726c
feat(contracts): add admin parameter setters
mempirate Oct 15, 2024
7bcd4b1
fix(contracts): move some storage variables to constants
mempirate Oct 15, 2024
6fa1359
feat(contracts): update deploy script directory structure
mempirate Oct 15, 2024
a10a15d
feat(contracts): rm redundant checks on BoltManager
mempirate Oct 15, 2024
104b1e6
test(contracts): restore some tests
mempirate Oct 15, 2024
8448b1c
feat(contracts): read configs from files
mempirate Oct 15, 2024
e873863
feat(contracts): deployment config, minimumOperatorStake parameter
mempirate Oct 15, 2024
a23ded0
fix(contracts): validate storage layout
mempirate Oct 15, 2024
e7467c6
chore: rm unrelated
mempirate Oct 15, 2024
1f779d4
feat(contracts): add Foundry profile settings for OZ Foundry Upgrades…
mempirate Oct 15, 2024
ff311eb
feat(contracts): indicate minimum collateral requirements in manager …
mempirate Oct 16, 2024
983d07b
docs(contracts): add ERD
mempirate Oct 16, 2024
08681c9
docs(contracts): update README
mempirate Oct 16, 2024
fb3dfe1
docs(contracts): update diagram
mempirate Oct 16, 2024
ce4b85b
docs(contracts): reduce img size
mempirate Oct 16, 2024
6ea2c48
feat(contracts): add parameter setters for operator stake and justifi…
mempirate Oct 16, 2024
50f4439
docs(contracts): more README updates
mempirate Oct 16, 2024
deb3c7d
docs(contracts): more README updates
mempirate Oct 16, 2024
2515d31
feat(contracts): update gas snapshot
mempirate Oct 16, 2024
c2df22e
Merge pull request #278 from chainbound/jonas/feat/registry-updates
mempirate Oct 16, 2024
cc8b5bf
feat(contracts): testing + documenting deployment
mempirate Oct 16, 2024
5cf7fef
feat(contracts): testing + documenting deployment
mempirate Oct 16, 2024
49f7138
fix(contracts): fix deploy script
mempirate Oct 16, 2024
a0a3637
feat(contracts): add UnsafeDeploy
mempirate Oct 17, 2024
260900e
feat(contracts): add Upgrade script (wip)
mempirate Oct 17, 2024
239bebc
docs(contracts): upgrading documenation
mempirate Oct 17, 2024
9b112a7
feat(contracts): upgrade script todos
mempirate Oct 17, 2024
f55fbd6
feat(contracts): symbiotic setup scripts
mempirate Oct 17, 2024
bf1d824
docs(contracts): deployment guide
mempirate Oct 17, 2024
563d015
docs(contracts): deployment guide
mempirate Oct 17, 2024
8b1f914
docs(contracts): upgrade guide
mempirate Oct 17, 2024
2b841c9
feat(contracts): update contracts
mempirate Oct 18, 2024
06bdd8e
chore(contracts): version interfaces
mempirate Oct 18, 2024
5ad010b
fix(contracts): script import paths
mempirate Oct 18, 2024
429352c
feat(contracts): rm collateral whitelisting
mempirate Oct 18, 2024
f4c4131
feat(contracts/deployment): correct vault & strategy whitelisting
mempirate Oct 18, 2024
096e76e
feat(contracts): add vault / strategy deregistration
mempirate Oct 18, 2024
f863e5c
feat(contracts/script): update script directory structure
mempirate Oct 18, 2024
eb29ff7
docs(contracts): udpate docs structure
mempirate Oct 18, 2024
4133ce6
feat(contracts/script): operator registration script
mempirate Oct 18, 2024
8299323
feat(contracts/script): symbiotic operator registration
mempirate Oct 20, 2024
675cf09
feat(contracts/script): register validators script
mempirate Oct 20, 2024
069e7f1
feat(contracts/script): fix scripts
mempirate Oct 20, 2024
c819a42
fix: symbiotic network opt-in
merklefruit Oct 21, 2024
c4b3d16
feat(contracts/script): fix registerValidators script
mempirate Oct 21, 2024
5e951ae
feat(contracts/script): include linux/amd64 script
mempirate Oct 21, 2024
f7dd940
feat(contracts/script): include other architectures
mempirate Oct 21, 2024
b536d08
docs(contracts): document compilation in pubkey_to_g1_wrapper.sh
mempirate Oct 21, 2024
89d8a70
chore(contracts): rm logs
mempirate Oct 21, 2024
ce3fadc
chore: revert adding middleware addresses
merklefruit Oct 21, 2024
10adbfb
Merge pull request #304 from chainbound/nico/chore/net-optin
merklefruit Oct 21, 2024
9965c03
Merge branch 'unstable' into nico/feat/commitment-registry
mempirate Oct 21, 2024
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
27 changes: 27 additions & 0 deletions .github/workflows/contracts_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Bolt-contracts CI

on: [push, pull_request]

jobs:
check:
name: Foundry project
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Run tests
run: forge test --via-ir -vvv
working-directory: bolt-contracts

- name: Run forge fmt
run: forge fmt --check
working-directory: bolt-contracts
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*_dump.log
logs/
target/
.vscode
.idea
Expand Down
15 changes: 12 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
[submodule "bolt-contracts/lib/openzeppelin-contracts"]
path = bolt-contracts/lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "bolt-contracts/lib/relic-sdk"]
path = bolt-contracts/lib/relic-sdk
url = https://github.com/Relic-Protocol/relic-sdk
[submodule "bolt-contracts/lib/core"]
path = bolt-contracts/lib/core
url = https://github.com/symbioticfi/core
[submodule "bolt-contracts/lib/eigenlayer-contracts"]
path = bolt-contracts/lib/eigenlayer-contracts
url = https://github.com/layr-labs/eigenlayer-contracts
[submodule "bolt-contracts/lib/openzeppelin-contracts-upgradeable"]
path = bolt-contracts/lib/openzeppelin-contracts-upgradeable
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
[submodule "bolt-contracts/lib/openzeppelin-foundry-upgrades"]
path = bolt-contracts/lib/openzeppelin-foundry-upgrades
url = https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades
34 changes: 34 additions & 0 deletions bolt-contracts/.gas-snapshot
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
BoltChallengerTest:testCannotResolveChallengeBeforeExpiration() (gas: 434902)
BoltChallengerTest:testCommitmentDigestAndSignature() (gas: 4626)
BoltChallengerTest:testCommitmentSignature() (gas: 6761)
BoltChallengerTest:testOpenAlreadyExistingChallenge() (gas: 13688)
BoltChallengerTest:testOpenChallengeInvalidSignature() (gas: 45916)
BoltChallengerTest:testOpenChallengeSingleTx() (gas: 424427)
BoltChallengerTest:testOpenChallengeWithIncorrectBond() (gas: 24909)
BoltChallengerTest:testOpenChallengeWithLargebond() (gas: 24920)
BoltChallengerTest:testOpenChallengeWithSlotInTheFuture() (gas: 25008)
BoltChallengerTest:testProveAccountData() (gas: 355542)
BoltChallengerTest:testProveHeaderData() (gas: 46360)
BoltChallengerTest:testProveTransactionInclusion() (gas: 176543)
BoltChallengerTest:testResolveChallengeFullDefenseSingleTx() (gas: 562694)
BoltChallengerTest:testResolveChallengeFullDefenseStackedTxs() (gas: 939716)
BoltChallengerTest:testResolveExpiredChallenge() (gas: 426457)
BoltManagerEigenLayerTest:testDeregisterOperatorFromAVS() (gas: 834106)
BoltManagerEigenLayerTest:testGetOperatorStake() (gas: 998169)
BoltManagerEigenLayerTest:testNonExistentProposerStatus() (gas: 980157)
BoltManagerEigenLayerTest:testNonWhitelistedCollateral() (gas: 103778)
BoltManagerEigenLayerTest:testProposerStatus() (gas: 1007174)
BoltManagerEigenLayerTest:testProposersLookaheadStatus() (gas: 2302759)
BoltManagerEigenLayerTest:testWhitelistedCollaterals() (gas: 99260)
BoltManagerSymbioticTest:testGetNonExistentProposerStatus() (gas: 1265832)
BoltManagerSymbioticTest:testGetProposerStatus() (gas: 1508557)
BoltManagerSymbioticTest:testGetWhitelistedCollaterals() (gas: 17213)
BoltManagerSymbioticTest:testNonWhitelistedCollateral() (gas: 43806)
BoltManagerSymbioticTest:testProposersLookaheadStatus() (gas: 2582043)
BoltManagerSymbioticTest:testReadOperatorStake() (gas: 1541503)
BoltValidatorsTest:testUnsafeRegistration() (gas: 149361)
BoltValidatorsTest:testUnsafeRegistrationFailsIfAlreadyRegistered() (gas: 148862)
BoltValidatorsTest:testUnsafeRegistrationInvalidOperator() (gas: 22820)
BoltValidatorsTest:testUnsafeRegistrationWhenNotAllowed() (gas: 33183)
TransactionDecoderTest:testDecodeAllTestCases() (gas: 0)
TransactionDecoderTest:testDecodeGasUsage() (gas: 53281)
6 changes: 6 additions & 0 deletions bolt-contracts/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
cache/
out/
broadcast/
logs/

.env

node_modules/
target/
341 changes: 281 additions & 60 deletions bolt-contracts/README.md

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions bolt-contracts/config/holesky/deployments.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"bolt": {
"validators": "0x05275a4799cd1B07D81319390fC62Bc7BDbDf269"
},
"symbiotic": {
"network": "0x90F79bf6EB2c4f870365E785982E1f101E93b906",
"operatorRegistry": "0xAdFC41729fF447974cE27DdFa358A0f2096c3F39",
"networkOptInService": "0xF5AFc9FA3Ca63a07E529DDbB6eae55C665cCa83E",
"vaultFactory": "0x18C659a269a7172eF78BBC19Fe47ad2237Be0590",
"networkRegistry": "0xac5acD8A105C8305fb980734a5AD920b5920106A",
"networkMiddlewareService": "0x683F470440964E353b389391CdDDf8df381C282f",
"middleware": "",
"supportedVaults": [
"0x1df2fbfcD600ADd561013f44B2D055E2e974f605",
"0xf427d00c34609053d97167352061DD2F0F27F853"
]
},
"eigenLayer": {
"avsDirectory": "0x055733000064333CaDDbC92763c58BF0192fFeBf",
"delegationManager": "0xA44151489861Fe9e3055d95adC98FbD462B948e7",
"strategyManager": "0xdfB5f6CE42aAA7830E94ECFCcAd411beF4d4D5b6",
"middleware": "",
"supportedStrategies": [
"0x7D704507b76571a51d9caE8AdDAbBFd0ba0e63d3",
"0x3A8fBdf9e77DFc25d09741f51d3E181b25d0c4E0",
"0x80528D6e9A2BAbFc766965E0E26d5aB08D9CFaF9",
"0x70EB4D3c164a6B4A5f908D4FBb5a9cAfFb66bAB6",
"0xaccc5A86732BE85b5012e8614AF237801636F8e5"
]
}
}
5 changes: 5 additions & 0 deletions bolt-contracts/config/holesky/operator.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"rpc": "localhost:50051",
"salt": "0x000000000000000abc0000000000000000000000000000000000000000000000",
"expiry": null
}
12 changes: 12 additions & 0 deletions bolt-contracts/config/holesky/parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"epochDuration": 86400,
"slashingWindow": 604800,
"maxChallengeDuration": 604800,
"challengeBond": 1000000000000000000,
"blockhashEvmLookback": 256,
"justificationDelay": 32,
"eth2GenesisTimestamp": 1694786400,
"slotTime": 12,
"allowUnsafeRegistration": true,
"minimumOperatorStake": 1000000000000000000
}
8 changes: 8 additions & 0 deletions bolt-contracts/config/holesky/validators.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"maxCommittedGasLimit": 10000000,
"authorizedOperator": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"pubkeys": [
"0xad02df40e24e8534dc4c175163f7a034f99f2e81c43b7ea19904006cb05d001b5301d3444f1812b101803b7f72e340fa",
"0xa4c0a8b5dd70d0fe8f05580143bea4c40badb176c2b0c20001cddf897a11bb832137fa4050af1d0420a7dc27568697df"
]
}
12 changes: 12 additions & 0 deletions bolt-contracts/config/test/parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"epochDuration": 86400,
"slashingWindow": 604800,
"maxChallengeDuration": 604800,
"challengeBond": 1000000000000000000,
"blockhashEvmLookback": 256,
"justificationDelay": 32,
"eth2GenesisTimestamp": 1606824023,
"slotTime": 12,
"allowUnsafeRegistration": true,
"minimumOperatorStake": 1000000000000000000
}
7 changes: 7 additions & 0 deletions bolt-contracts/docs/admin/avs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "Bolt Protocol",
"website": "https://boltprotocol.xyz",
"description": "Bolt Protocol enables proposers to make credible commitments about their blocks.",
"logo": "http://boltprotocol.xyz/wp-content/uploads/2024/07/Bolt-Logo.png",
"twitter": "https://twitter.com/boltprotocol_"
}
73 changes: 73 additions & 0 deletions bolt-contracts/docs/admin/deploying.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Deployment Guide

**This should only be done once with the `V1` contracts. For upgrades, refer to the [upgrading doc](./upgrading.md).**

## Configuration

There are 2 JSON configuration files:
- [`config/holesky/deployments.json`](../../config/holesky/deployments.json): contains deployment addresses of EigenLayer ([here](https://github.com/Layr-Labs/eigenlayer-contracts/blob/dev/README.md#deployments)) and Symbiotic ([here](https://docs.symbiotic.fi/deployments)).
- [`config/holesky/parameters.json`](../../config/holesky/parameters.json): contains the launch parameters for `BoltParameters`.



## Deployment Guide
Make sure we have a full compilation for the Foundry Upgrades Toolkit:
```bash
forge clean && forge build
```

And have a local Anvil fork running to test and validate deployments:

```bash
anvil --fork-url $HOLESKY_RPC
```

> [!IMPORTANT]
> Run everything on the local Anvil fork first! This requires just replacing the $HOLESKY_RPC with the $ANVIL_RPC.

Also set your private keys as environment variables:

```bash
export NETWORK_PRIVATE_KEY=0x...
export ADMIN_PRIVATE_KEY=0x...
```

### Pre-deployment

Register a Symbiotic network for Bolt with the Symbiotic `NetworkRegistry`. The private key with which the script is run will determine the network address. This private key will also need to be used later.

```bash
forge script script/holesky/admin/helpers/Symbiotic.s.sol --rpc-url $HOLESKY_RPC --private-key $NETWORK_PRIVATE_KEY --broadcast -vvvv --sig "run(string memory arg)" registerNetwork
```

Make sure `deployments.json` contains the correct address for the Symbiotic network.

### Deployment

Run the following script to deploy Bolt V1:
```bash
forge script script/holesky/admin/Deploy.s.sol --rpc-url $HOLESKY_RPC --private-key $ADMIN_PRIVATE_KEY --broadcast -vvvv
```

This will deploy all the contracts. The address corresponding to the private key will be the system admin.

Now update `deployments.json` with the Symbiotic and EigenLayer middleware contracts, because we'll need to register it in the next step. Also update the `bolt` section with the correct addresses.

### Post-deployment

Register the deployed `SymbioticMiddleware` with the Symbiotic `NetworkMiddlewareService`. IMPORTANT: this script needs
to be run with the network private key!

```bash
forge script script/holesky/admin/helpers/Symbiotic.s.sol --rpc-url $HOLESKY_RPC --private-key $NETWORK_PRIVATE_KEY --broadcast -vvvv --sig "run(string memory arg)" registerMiddleware
```

Also set the AVS metadata in the EigenLayer AVS Directory, needs to be run with the **admin private key** used at deployment.

```bash
forge script script/holesky/admin/helpers/RegisterAVS.s.sol --rpc-url $HOLESKY_RPC --private-key $ADMIN_PRIVATE_KEY --broadcast -vvvv
```

> [!IMPORTANT]
> After the `deployments.json` file has been fully updated with the correct contract addresses, push it to Github.

16 changes: 16 additions & 0 deletions bolt-contracts/docs/admin/upgrading.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Upgrading Guide

When upgrading contracts, always keep the old implementation of the contracts around and increment the version number.
For example, when upgrading `BoltManagerV1`, copy it into a new file called `BoltManagerV2` and make your changes.

This is needed to reference check the new contracts with the old contracts so that the OpenZeppelin Upgrades library can
validate the safety of the upgrade. You MUST add this reference when upgrading a contract:

```solidity
Options memory opts;
opts.referenceContract = "BoltManagerV1.sol";
bytes memory initManager = abi.encodeCall(BoltManagerV2.initialize, (params));
Upgrades.upgradeProxy(proxy, "BoltManagerV2.sol", initManager, opts);
```

Before an upgrade, update the [`Upgrade.s.sol`](../script/holesky/Upgrade.s.sol) script to include the correct contracts, references and configurations.
Binary file added bolt-contracts/docs/erd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 67 additions & 0 deletions bolt-contracts/foundry.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,73 @@
[profile.default]
solc = "0.8.25"
via_ir = true
src = "src"
out = "out"
libs = ["lib"]
fs_permissions = [{ access = "read-write", path = "./" }]
gas_reports = ["*"]
# Required options for the OpenZeppelin Foundry Upgrades toolkit: https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades
ffi = true
ast = true
build_info = true
extra_output = ["storageLayout"]

# silence some warnings during compilation
# https://book.getfoundry.sh/reference/config/solidity-compiler#ignored_error_codes
ignored_error_codes = [3628, 1878, 5574]
ignored_warnings_from = [
"lib/openzeppelin-contracts/contracts",
"lib/core",
"lib/eigenlayer-contracts",
]

remappings = [
# Bolt remappings
"@relic/=lib/relic-sdk/packages/contracts",
"@symbiotic/=lib/core/src/",
"@eigenlayer/=lib/eigenlayer-contracts/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"@openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/",

# Symbiotic remappings contexts
"lib/core/:forge-std/=lib/core/lib/forge-std/src/",
"lib/core/:@openzeppelin/contracts/=lib/core/lib/openzeppelin-contracts/contracts/",
"lib/core/:@openzeppelin/contracts-upgradeable/=lib/core/lib/openzeppelin-contracts-upgradeable/contracts/",

# Eigenlayer remappings contexts
"lib/eigenlayer-contracts/:@openzeppelin-upgrades/=lib/eigenlayer-contracts/lib/openzeppelin-contracts-upgradeable/",
"lib/eigenlayer-contracts/:@openzeppelin/=lib/eigenlayer-contracts/lib/openzeppelin-contracts/",
"lib/eigenlayer-contracts/:@openzeppelin-v4.9.0/=lib/eigenlayer-contracts/lib/openzeppelin-contracts-v4.9.0/",
"lib/eigenlayer-contracts/:@openzeppelin-upgrades-v4.9.0/=lib/eigenlayer-contracts/lib/openzeppelin-contracts-upgradeable-v4.9.0/",
"lib/eigenlayer-contracts/:ds-test/=lib/eigenlayer-contracts/lib/ds-test/src/",
"lib/eigenlayer-contracts/:forge-std/=lib/eigenlayer-contracts/lib/forge-std/src/",
"lib/eigenlayer-contracts/lib/openzeppelin-contracts/:@openzeppelin/contracts/=lib/eigenlayer-contracts/lib/openzeppelin-contracts/contracts/",

# OpenZeppelin remappings contexts
"lib/openzeppelin-contracts/:@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
]


[rpc_endpoints]
mainnet = "${ETH_RPC_URL}"
holesky = "${ETH_RPC_URL_HOLESKY}"

[fmt]
bracket_spacing = false
int_types = "long"
line_length = 120
multiline_func_header = "params_first"
number_underscore = "thousands"
quote_style = "double"
tab_width = 4

[fuzz]
runs = 4096
max_test_rejects = 262144

# [etherscan]
# mainnet = { key = "${ETHERSCAN_API_KEY_MAINNET}" }
# holesky = { key = "${ETHERSCAN_API_KEY_HOLESKY}" }

# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
5 changes: 5 additions & 0 deletions bolt-contracts/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module bolt-contracts

go 1.22.7

require github.com/supranational/blst v0.3.11
2 changes: 2 additions & 0 deletions bolt-contracts/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/supranational/blst v0.3.11 h1:LyU6FolezeWAhvQk0k6O/d49jqgO52MSDDfYgbeoEm4=
github.com/supranational/blst v0.3.11/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw=
1 change: 1 addition & 0 deletions bolt-contracts/lib/core
Submodule core added at 76bf70
1 change: 1 addition & 0 deletions bolt-contracts/lib/eigenlayer-contracts
Submodule eigenlayer-contracts added at 00fc4b
1 change: 1 addition & 0 deletions bolt-contracts/lib/openzeppelin-foundry-upgrades
1 change: 0 additions & 1 deletion bolt-contracts/lib/relic-sdk
Submodule relic-sdk deleted from 8d6c88
Loading
Loading