Skip to content

Commit

Permalink
Chore/rebase master (#115)
Browse files Browse the repository at this point in the history
* fix: remove husky command that only needs to be run once

* update nonSignerForQuorumIndex outside of loop

* chore: add MacOS indexing file to gitignore

* chore: correct addresses for M2 Goerli deployment

switch these addresses over from pre-prod environment to the addresses that EigenDA is using now

* chore: test out relative import

* chore: all relative imports

* chore: fix remaining relative imports

* fix: update missed import

* fix: additional missed imports

* Update README.md to avoid confusing phrasing (#75)

* style: use  for loop indices when the index is just an index

* refactor: Use a signed delta value in StakeRegistry to remove tons of unneeded code

* style: use  over , and simplify

* feat: only update total history for nonzero delta, and dont push update if last update was in current block

* style: use uint256 in registry coordinator

* test: fix broken tests for StakeRegistry changes

generally i just removed testing of specific stake histories in favor of testing net outcomes. we can revisit these tests in a few weeks.

* refactor: wip refactor to move "createQuorum" to the registry coordinator

* style: use  for loop indices when the index is just an index

* refactor: Use a signed delta value in StakeRegistry to remove tons of unneeded code

* style: use  over , and simplify

* feat: only update total history for nonzero delta, and dont push update if last update was in current block

* style: use uint256 in registry coordinator

* test: fix broken tests for StakeRegistry changes

generally i just removed testing of specific stake histories in favor of testing net outcomes. we can revisit these tests in a few weeks.

* fix: fix compilation issues and tests

* refactor: wip refactor for index and blspubkey registries to simplify naming and logic

* style: pull out common logic to a helper method

* style: pulled additional logic out into a helper method

* refactor: simplify registry coord state variable names and clean logic and comments for deregistration

* fix: enforce invariant that existing indice have nonzero length history. also fix tests

* style: shorten state variable and function naming in registry coordinator

* style: shorten state variable and function naming in stake registry

* style: remove unused index registry function

* refactor: pk compendium stores operator pubkeys and can look them up

... which means pubkey parameters for various functions/structs can be removed

* style: shorten state variable and function names to be more consistent with other registry contracts

* style: removed redundant check and swapped param order to be consistent with corresponding state lookup

* style: remove redundant checks from pubkey compendium

* fix: replace borked state variable

* refactor: move updateStakes to registry coordinator

* fix: fixes several compiler issues

still running into "stack too deep"

* fix: stack too deep issue addressed

also addressed review comments:
- natspec comments in IStakeRegistry
- incorrect boolean in StakeRegistry

* fix: actually commit natspec changes

* style: stakeregistry naming is more consistent with other contracts

* style: rename upper bound in bitmap utils, and rename Operator to OperatorInfo

* fix: operator has minimum if weight is equal to minimum

* test: update tests to support refactor

* style: reword comments and remove duplicate check

* style: remove unneeded parenthesis and fix _registerOperator naming

* style: rename OperatorStakeUpdate struct to StakeUpdate, and swap event to match (#61)

* cleanup imports (#78)

* chore: merge master into m2-mainnet (#79)


---------

Co-authored-by: steven <[email protected]>
Co-authored-by: gpsanant <[email protected]>
Co-authored-by: ChaoticWalrus <[email protected]>
Co-authored-by: Gautham Anant <[email protected]>

* build: point eigenlayer gitmodule to m2-mainnet (#80)

* ci: add rule to run CI on m2-mainnet branch

* chore: remove old tree file (#83)

Co-authored-by: steven <[email protected]>

* chore: rename several contracts and fix interfaces and tests (#95)

- BLSRegistryCoordinatorWithIndices is now RegistryCoordinator
- BLSOperatorStateRetriever is now OperatorStateRetriever
- BLSPubkeyRegistry is now BLSApkRegistry

* chore: copy BLSPublicKeyCompendium storage and functions into BLSApkRegistry

* chore: delete BLSPublicKeyCompendium and associated interface

requires changing a bunch of files to make things work.
I had to comment out a few calls in tests (now marked with a `TODO`) to get this past the compiler.
Will have to do additional cleanup to get this ready for review.

* feat: create harness for BLSApkRegistry and use it in tests

These changes appear to fix all existing tests.
I've done what I can to at least comment specifically where harnessed functions are used, as this pattern could give some false assurance and I'd like to avoid that.

* chore: delete unused mock file

I created this mock while trying to sort out compilation issues and test failures
This mock is no longer being used anywhere, so I am deleting it for cleanup

* chore: cleanup unused file and reduce mutability of test utils functions

this commit fixes a ton of compiler warnings on build, in particular.

* feat: make BLSApkRegistry. registerBLSPublicKey only callable by RegistryCoordinator

also make a version of `RegistryCoordinator. registerOperator`
that accepts these inputs
new function passes these inputs on appropriately

TODO:
remove old `registerOperator` function and fix associated tests

* chore: remove `RegistryCoordinator.registerOperator` method without pubkey registration inputs

also fix tests to use the new method

* feat: create struct for pubkey registration params

note: code is currently not compiling due to a stack-too-deep error
error here:
 src/RegistryCoordinator.sol:254:69:
    |
254 |                 _deregisterOperator(operatorKickParams[i].operator, quorumNumbers[i:i+1]);

* fix: address stack-too-deep issue in RegistryCoordinator

* chore: delete unused index

see reasoning here
#100 (comment)
this allows undoing a previous fix for a stack-too-deep error, which...
helps make the logic a little clearer / easier to parse here.

* feat: optimization for fetching operatorId

NOTE: this changes the IBLSApkRegistry interface
to make `registerBLSPublicKey` return a bytes32 object

* chore: shorten variable name that is quite clear from context

`pubkeyRegistrationParams` => `params`
see discussion here:
#100 (comment)

* feat: use EIP712 for the pubkeyRegistrationMessageHash

this commit also moves the definition to the RegistryCoordinator contract
and updates the function naming to be clearer

* chore: add NatSpec to getter function

* Feat(M2-Mainnet): StakeRegistry pull updates per quorum (#62)

* feat: initial implementation w/o timestamp

* feat: enforce stake updates for quorum in sigcheck

* fix: update operator stake for just one quorum

Additionally
- renamed updateOperatorsPerQuorum to updateOperatorsForQuorum
- sort by operator addresses instead of operatorIds

* fix: requested changes and optimizations

- sorted by ascending address instead of operatorId
- sanitization checks on quorumNumbers, added quorumsAllExist modifier
- performing `OperatorStatus.REGISTERED` checks now
- Removed uneccesary bitmapToBytes calls and doing bytes slicing for quorumNumbers
- using internal function and scoping to fix stack-too-deep

* refactor: move quorumUpdateTimestamp to reg coord

* refactor: remove modifier in favor of helper method (#64)

* fix: initializedQuorumBitmap fix

small off by 1 error, for example of quorumCount = 1,3
1 << 1 = 2, bit rep is 10
1 << 1 - 1 = 1, bit rep is 01

1 << 3 = 8, bit rep is 1000
1 << 3 - 1 = 7, bit rep is 0111
We should be subtracting by 1 instead of 2 here to get the bitmap

* fix: bitshifting error, needs to shift first before subtracting

* fix: moved 1 weeks to a constant for now

May change this in the future to be configurable

* chore: require statement

* refactor: move shared logic to `_updateOperator`

* refactor: added status check to `_updateOperator`

* feat: Delegation.withdrawalDelayBlocks in sigcheck

* fix: use blocknumber instead of timestamp

* fix: unused constant and require error

* feat: timestamp requirement is able to be toggled

* fix: interface imports

* chore: renamed to staleStakesForbidden

* chore: typo with BlockNumber

* fix: rebase remove deleted file

* fix: prevOperatorAddress not being updated

---------

Co-authored-by: Alex <[email protected]>

* feat: issue templates (#87)

Co-authored-by: steven <[email protected]>

* fix typo BLSPublicKeyCompendium.md

* fix typo BLSSignatureChecker.md

* fix typo StakeRegistry.md

* fix typo README.md

* chore: remove ServiceManagerBase and add RegistryCoordinator owner (#98)

* Feat: Add AVS/Operator Registration Support in RegistryCoordinator (#99)

* chore: fix merge artifacts / broken calls

these weren't caught in merging but were causing compiler errors

* chore: re-implement stack-too-deep fix

I previously implemented this fix, then reverted it as not needed.
Now upon merging with m2-mainnet, `registerOperatorWithChurn` has an additional input.
This is reintroducing the same stack-too-deep error
so I am reintroducing the same fix (one less local var)

* chore: de-duplicate code into an internal function

see suggestion here:
#102 (comment)

saves ~0.25kb in code size

* fix: actually use the `operator` input to `_getOrCreateOperatorId`

also reduce memory copying operations (I think, at least) in
the `registerOperator` function
specifically, only copy the `numOperatorsPerQuorum` returned by
the internal `_registerOperator` function

* feat: add optimizer runs count to foundry config

* chore: remove redundant check and return data

The `operatorId` in this check is already fetched from the `blsApkRegistry`
With the other changes, this return data is no longer necessary at all

* chore: fewer memory operations(?)

I believe this change cuts down on the memory copying being done here

* fix: reduce optimizer runs to meet contract code size limits

Likely not the ideal fix, but it gets the job done for the moment, at least.

* chore: rename file to reflect it only being used in tests

`RegistryCoordinatorHarness.sol` -> `RegistryCoordinatorHarness.t.sol`

* chore: delete unused (memory) variable

* fix: have the harness import Test so it gets ignored in build sizes

* fix: remove circular dependency (#108)

* fix: address multiple issues in BLSSignatureChecker, optimize, and clean (#104)

* fix: swap sign on sig checker withdrawal delay check

* fix: tiny_scalar_mul in BN254 and additional cleanup

- unify validateXAtBlockNumber style checks in registries
- checkSignatures changes below
- rename variables to be more readable
- validate input lengths for quorum and nonsigner params
- create signingQuorumBitmap using method with additional validation to avoid duplicates
- clarify commenting and style to be more consistent with rest of codebase
- cache state to avoid lookups in loop
- move total stake query to initial loop

* fix: refactor checkSignatures to remove an unneeded loop

- also optimizes BN254.hashG1Point
- also refactors checkSignatures to avoid negating pubkeys multiple times

* fix: stale stakes check should care about referenceBlockNumber

* fix: remove repeated storage read from loop

* chore: remove TODOs

* docs: add wip docs and clean main README (#96)

* docs: add docs very wip

* docs: wip add docs and main README

* docs: wip main README

* docs: more wip

* docs: get docs to a good ish state

* docs: address feedback

* chore: add eigenda goerli deployment (#111)

* feat: concentrate eigenlayer avs interactions into service manager (#109)

* feat: reintroduce IServiceManager & ServiceManagerBase

These are useful concepts to form the single interaction point
where AVSs push data to EigenLayer.
The previous version focused on (unused) Slashing interactions,
whereas this version focused on the newer registration interactions.
TODO: modify the RegistryCoordinator to call the ServiceManagerBase
instead of calling the DelegationManager directly.

* feat: integrate RegistryCoordinator with ServiceManager(Base)

achieves the goal of a single interaction point with EigenLayer (per AVS).
all calls which push data to EigenLayer core are now forwarded via the ServiceManager(Base)

* fix: use correct addresses in test setup + functions

simple follow-up commit to fix breaking tests from last commit

* chore: restore optimizer_runs to 200

other changes in this PR remove enough from the size
of the RegistryCoordinator contract to make this possible.
200 runs is a wider industry default +
this should slightly decrease gas costs for users.
we can switch back to 100 in the future if we ever need to

* chore: add `setMetadataURI` function to IServiceManager interface

* feat: add operator strategy indexing to service manager (#110)

---------

Co-authored-by: Yash Patil <[email protected]>

* fix: correctly set bit in stake registry (#112)

* feat: add restakeable strategies to service manager for indexing (#113)

* chore: resolve imports

* fix: remove eigenlayer deployer

* chore: additional relative imports

* chore: remove whitespace diff

* chore: clean up remappings

* chore: remove whitespace diff

* chore: stragglers

---------

Co-authored-by: steven <[email protected]>
Co-authored-by: Alex <[email protected]>
Co-authored-by: gpsanant <[email protected]>
Co-authored-by: ChaoticWalrus <[email protected]>
Co-authored-by: Gautham Anant <[email protected]>
Co-authored-by: Bowen Li <[email protected]>
Co-authored-by: wadealexc <[email protected]>
Co-authored-by: quaq <[email protected]>
Co-authored-by: Michael Sun <[email protected]>
Co-authored-by: iwantanode <[email protected]>
Co-authored-by: Yash Patil <[email protected]>
  • Loading branch information
12 people authored Dec 18, 2023
1 parent 7f90be1 commit a79742b
Show file tree
Hide file tree
Showing 33 changed files with 118 additions and 116 deletions.
6 changes: 3 additions & 3 deletions src/BLSApkRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import {BLSApkRegistryStorage} from "src/BLSApkRegistryStorage.sol";
import {BLSApkRegistryStorage} from "./BLSApkRegistryStorage.sol";

import {IRegistryCoordinator} from "src/interfaces/IRegistryCoordinator.sol";
import {IRegistryCoordinator} from "./interfaces/IRegistryCoordinator.sol";

import {BN254} from "src/libraries/BN254.sol";
import {BN254} from "./libraries/BN254.sol";

contract BLSApkRegistry is BLSApkRegistryStorage {
using BN254 for BN254.G1Point;
Expand Down
6 changes: 3 additions & 3 deletions src/BLSApkRegistryStorage.sol
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import {IBLSApkRegistry} from "src/interfaces/IBLSApkRegistry.sol";
import {IRegistryCoordinator} from "src/interfaces/IRegistryCoordinator.sol";
import {IBLSApkRegistry} from "./interfaces/IBLSApkRegistry.sol";
import {IRegistryCoordinator} from "./interfaces/IRegistryCoordinator.sol";

import {Initializable} from "@openzeppelin-upgrades/contracts/proxy/utils/Initializable.sol";

import {BN254} from "src/libraries/BN254.sol";
import {BN254} from "./libraries/BN254.sol";

abstract contract BLSApkRegistryStorage is Initializable, IBLSApkRegistry {
/// @notice the hash of the zero pubkey aka BN254.G1Point(0,0)
Expand Down
12 changes: 6 additions & 6 deletions src/BLSSignatureChecker.sol
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import {IBLSSignatureChecker} from "src/interfaces/IBLSSignatureChecker.sol";
import {IRegistryCoordinator} from "src/interfaces/IRegistryCoordinator.sol";
import {IBLSApkRegistry} from "src/interfaces/IBLSApkRegistry.sol";
import {IStakeRegistry, IDelegationManager} from "src/interfaces/IStakeRegistry.sol";
import {IBLSSignatureChecker} from "./interfaces/IBLSSignatureChecker.sol";
import {IRegistryCoordinator} from "./interfaces/IRegistryCoordinator.sol";
import {IBLSApkRegistry} from "./interfaces/IBLSApkRegistry.sol";
import {IStakeRegistry, IDelegationManager} from "./interfaces/IStakeRegistry.sol";

import {BitmapUtils} from "src/libraries/BitmapUtils.sol";
import {BN254} from "src/libraries/BN254.sol";
import {BitmapUtils} from "./libraries/BitmapUtils.sol";
import {BN254} from "./libraries/BN254.sol";

/**
* @title Used for checking BLS aggregate signatures from the operators of a `BLSRegistry`.
Expand Down
4 changes: 2 additions & 2 deletions src/IndexRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import {IndexRegistryStorage} from "src/IndexRegistryStorage.sol";
import {IRegistryCoordinator} from "src/interfaces/IRegistryCoordinator.sol";
import {IndexRegistryStorage} from "./IndexRegistryStorage.sol";
import {IRegistryCoordinator} from "./interfaces/IRegistryCoordinator.sol";

/**
* @title A `Registry` that keeps track of an ordered list of operators for each quorum
Expand Down
4 changes: 2 additions & 2 deletions src/IndexRegistryStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ pragma solidity =0.8.12;

import {Initializable} from "@openzeppelin-upgrades/contracts/proxy/utils/Initializable.sol";

import {IRegistryCoordinator} from "src/interfaces/IRegistryCoordinator.sol";
import {IIndexRegistry} from "src/interfaces/IIndexRegistry.sol";
import {IRegistryCoordinator} from "./interfaces/IRegistryCoordinator.sol";
import {IIndexRegistry} from "./interfaces/IIndexRegistry.sol";

/**
* @title Storage variables for the `IndexRegistry` contract.
Expand Down
10 changes: 5 additions & 5 deletions src/OperatorStateRetriever.sol
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import {IRegistryCoordinator} from "src/interfaces/IRegistryCoordinator.sol";
import {IBLSApkRegistry} from "src/interfaces/IBLSApkRegistry.sol";
import {IStakeRegistry} from "src/interfaces/IStakeRegistry.sol";
import {IIndexRegistry} from "src/interfaces/IIndexRegistry.sol";
import {IRegistryCoordinator} from "./interfaces/IRegistryCoordinator.sol";
import {IBLSApkRegistry} from "./interfaces/IBLSApkRegistry.sol";
import {IStakeRegistry} from "./interfaces/IStakeRegistry.sol";
import {IIndexRegistry} from "./interfaces/IIndexRegistry.sol";

import {BitmapUtils} from "src/libraries/BitmapUtils.sol";
import {BitmapUtils} from "./libraries/BitmapUtils.sol";

/**
* @title OperatorStateRetriever with view functions that allow to retrieve the state of an AVSs registry system.
Expand Down
18 changes: 9 additions & 9 deletions src/RegistryCoordinator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ import {EIP1271SignatureUtils} from "eigenlayer-contracts/src/contracts/librarie
import {IPauserRegistry} from "eigenlayer-contracts/src/contracts/interfaces/IPauserRegistry.sol";
import {Pausable} from "eigenlayer-contracts/src/contracts/permissions/Pausable.sol";

import {IRegistryCoordinator} from "src/interfaces/IRegistryCoordinator.sol";
import {IRegistryCoordinator} from "./interfaces/IRegistryCoordinator.sol";
import {ISignatureUtils} from "eigenlayer-contracts/src/contracts/interfaces/ISignatureUtils.sol";
import {IBLSApkRegistry} from "src/interfaces/IBLSApkRegistry.sol";
import {ISocketUpdater} from "src/interfaces/ISocketUpdater.sol";
import {IStakeRegistry} from "src/interfaces/IStakeRegistry.sol";
import {IIndexRegistry} from "src/interfaces/IIndexRegistry.sol";
import {IServiceManager} from "src/interfaces/IServiceManager.sol";

import {BitmapUtils} from "src/libraries/BitmapUtils.sol";
import {BN254} from "src/libraries/BN254.sol";
import {IBLSApkRegistry} from "./interfaces/IBLSApkRegistry.sol";
import {ISocketUpdater} from "./interfaces/ISocketUpdater.sol";
import {IStakeRegistry} from "./interfaces/IStakeRegistry.sol";
import {IIndexRegistry} from "./interfaces/IIndexRegistry.sol";
import {IServiceManager} from "./interfaces/IServiceManager.sol";

import {BitmapUtils} from "./libraries/BitmapUtils.sol";
import {BN254} from "./libraries/BN254.sol";

/**
* @title A `RegistryCoordinator` that has three registries:
Expand Down
8 changes: 4 additions & 4 deletions src/ServiceManagerBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ pragma solidity =0.8.12;

import {OwnableUpgradeable} from "@openzeppelin-upgrades/contracts/access/OwnableUpgradeable.sol";

import {BitmapUtils} from "src/libraries/BitmapUtils.sol";
import {BitmapUtils} from "./libraries/BitmapUtils.sol";
import {ISignatureUtils} from "eigenlayer-contracts/src/contracts/interfaces/ISignatureUtils.sol";
import {IDelegationManager} from "eigenlayer-contracts/src/contracts/interfaces/IDelegationManager.sol";

import {IServiceManager} from "src/interfaces/IServiceManager.sol";
import {IRegistryCoordinator} from "src/interfaces/IRegistryCoordinator.sol";
import {IStakeRegistry} from "src/interfaces/IStakeRegistry.sol";
import {IServiceManager} from "./interfaces/IServiceManager.sol";
import {IRegistryCoordinator} from "./interfaces/IRegistryCoordinator.sol";
import {IStakeRegistry} from "./interfaces/IStakeRegistry.sol";

/**
* @title Minimal implementation of a ServiceManager-type contract.
Expand Down
8 changes: 4 additions & 4 deletions src/StakeRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ pragma solidity =0.8.12;

import {IDelegationManager} from "eigenlayer-contracts/src/contracts/interfaces/IDelegationManager.sol";

import {StakeRegistryStorage} from "src/StakeRegistryStorage.sol";
import {StakeRegistryStorage} from "./StakeRegistryStorage.sol";

import {IRegistryCoordinator} from "src/interfaces/IRegistryCoordinator.sol";
import {IStakeRegistry} from "src/interfaces/IStakeRegistry.sol";
import {IRegistryCoordinator} from "./interfaces/IRegistryCoordinator.sol";
import {IStakeRegistry} from "./interfaces/IStakeRegistry.sol";

import {BitmapUtils} from "src/libraries/BitmapUtils.sol";
import {BitmapUtils} from "./libraries/BitmapUtils.sol";

/**
* @title A `Registry` that keeps track of stakes of operators for up to 256 quorums.
Expand Down
4 changes: 2 additions & 2 deletions src/StakeRegistryStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ pragma solidity =0.8.12;
import {IDelegationManager} from "eigenlayer-contracts/src/contracts/interfaces/IDelegationManager.sol";
import {IStrategyManager} from "eigenlayer-contracts/src/contracts/interfaces/IStrategyManager.sol";

import {IRegistryCoordinator} from "src/interfaces/IRegistryCoordinator.sol";
import {IStakeRegistry} from "src/interfaces/IStakeRegistry.sol";
import {IRegistryCoordinator} from "./interfaces/IRegistryCoordinator.sol";
import {IStakeRegistry} from "./interfaces/IStakeRegistry.sol";

/**
* @title Storage variables for the `StakeRegistry` contract.
Expand Down
4 changes: 2 additions & 2 deletions src/interfaces/IBLSApkRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import {IRegistry} from "src/interfaces/IRegistry.sol";
import {IRegistry} from "./IRegistry.sol";

import {BN254} from "src/libraries/BN254.sol";
import {BN254} from "../libraries/BN254.sol";

/**
* @title Minimal interface for a registry that keeps track of aggregate operator public keys for among many quorums.
Expand Down
8 changes: 4 additions & 4 deletions src/interfaces/IBLSSignatureChecker.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import {IRegistryCoordinator} from "src/interfaces/IRegistryCoordinator.sol";
import {IBLSApkRegistry} from "src/interfaces/IBLSApkRegistry.sol";
import {IStakeRegistry, IDelegationManager} from "src/interfaces/IStakeRegistry.sol";
import {IRegistryCoordinator} from "./IRegistryCoordinator.sol";
import {IBLSApkRegistry} from "./IBLSApkRegistry.sol";
import {IStakeRegistry, IDelegationManager} from "./IStakeRegistry.sol";

import {BN254} from "src/libraries/BN254.sol";
import {BN254} from "../libraries/BN254.sol";

/**
* @title Used for checking BLS aggregate signatures from the operators of a EigenLayer AVS with the RegistryCoordinator/BLSApkRegistry/StakeRegistry architechture.
Expand Down
8 changes: 4 additions & 4 deletions src/interfaces/IRegistryCoordinator.sol
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import {IBLSApkRegistry} from "src/interfaces/IBLSApkRegistry.sol";
import {IStakeRegistry} from "src/interfaces/IStakeRegistry.sol";
import {IIndexRegistry} from "src/interfaces/IIndexRegistry.sol";
import {BN254} from "src/libraries/BN254.sol";
import {IBLSApkRegistry} from "./IBLSApkRegistry.sol";
import {IStakeRegistry} from "./IStakeRegistry.sol";
import {IIndexRegistry} from "./IIndexRegistry.sol";
import {BN254} from "../libraries/BN254.sol";

/**
* @title Interface for a contract that coordinates between various registries for an AVS.
Expand Down
6 changes: 3 additions & 3 deletions test/ffi/BLSPubKeyCompendiumFFI.t.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import "src/BLSApkRegistry.sol";
import "test/ffi/util/G2Operations.sol";
import {IBLSApkRegistry} from "src/interfaces/IBLSApkRegistry.sol";
import "../../src/BLSApkRegistry.sol";
import "../ffi/util/G2Operations.sol";
import {IBLSApkRegistry} from "../../src/interfaces/IBLSApkRegistry.sol";

contract BLSApkRegistryFFITests is G2Operations {
using BN254 for BN254.G1Point;
Expand Down
12 changes: 6 additions & 6 deletions test/ffi/BLSSignatureCheckerFFI.t.sol
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import {G2Operations} from "test/ffi/util/G2Operations.sol";
import {MockAVSDeployer} from "test/utils/MockAVSDeployer.sol";
import {BLSSignatureChecker} from "src/BLSSignatureChecker.sol";
import {OperatorStateRetriever} from "src/OperatorStateRetriever.sol";
import {BN254} from "src/libraries/BN254.sol";
import {BitmapUtils} from "src/libraries/BitmapUtils.sol";
import {G2Operations} from "../ffi/util/G2Operations.sol";
import {MockAVSDeployer} from "../utils/MockAVSDeployer.sol";
import {BLSSignatureChecker} from "../../src/BLSSignatureChecker.sol";
import {OperatorStateRetriever} from "../../src/OperatorStateRetriever.sol";
import {BN254} from "../../src/libraries/BN254.sol";
import {BitmapUtils} from "../../src/libraries/BitmapUtils.sol";


contract BLSSignatureCheckerFFITests is MockAVSDeployer, G2Operations {
Expand Down
2 changes: 1 addition & 1 deletion test/ffi/util/G2Operations.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity =0.8.12;

import "forge-std/Test.sol";
import "openzeppelin-contracts/contracts/utils/Strings.sol";
import "src/libraries/BN254.sol";
import "../../../src/libraries/BN254.sol";

contract G2Operations is Test {
using Strings for uint256;
Expand Down
2 changes: 1 addition & 1 deletion test/harnesses/BLSApkRegistryHarness.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import "src/BLSApkRegistry.sol";
import "../../src/BLSApkRegistry.sol";

// wrapper around the BLSApkRegistry contract that exposes internal functionality, for unit testing _other functionality_.
contract BLSApkRegistryHarness is BLSApkRegistry {
Expand Down
2 changes: 1 addition & 1 deletion test/harnesses/BitmapUtilsWrapper.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import "src/libraries/BitmapUtils.sol";
import "../../src/libraries/BitmapUtils.sol";

// wrapper around the BitmapUtils library that exposes the internal functions
contract BitmapUtilsWrapper {
Expand Down
2 changes: 1 addition & 1 deletion test/harnesses/RegistryCoordinatorHarness.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import "src/RegistryCoordinator.sol";
import "../../src/RegistryCoordinator.sol";

import "forge-std/Test.sol";

Expand Down
2 changes: 1 addition & 1 deletion test/harnesses/StakeRegistryHarness.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import "src/StakeRegistry.sol";
import "../../src/StakeRegistry.sol";

// wrapper around the StakeRegistry contract that exposes the internal functions for unit testing.
contract StakeRegistryHarness is StakeRegistry {
Expand Down
4 changes: 2 additions & 2 deletions test/integration/CoreRegistration.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import "test/utils/MockAVSDeployer.sol";
import "../utils/MockAVSDeployer.sol";
import { DelegationManager } from "eigenlayer-contracts/src/contracts/core/DelegationManager.sol";
import { IDelegationManager } from "eigenlayer-contracts/src/contracts/interfaces/IDelegationManager.sol";

Expand Down Expand Up @@ -185,4 +185,4 @@ contract Test_CoreRegistration is MockAVSDeployer {
return operatorSignature;
}

}
}
2 changes: 1 addition & 1 deletion test/mocks/RegistryCoordinatorMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity =0.8.12;


import "src/interfaces/IRegistryCoordinator.sol";
import "../../src/interfaces/IRegistryCoordinator.sol";


contract RegistryCoordinatorMock is IRegistryCoordinator {
Expand Down
4 changes: 2 additions & 2 deletions test/mocks/StakeRegistryMock.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import "src/interfaces/IStakeRegistry.sol";
import "src/interfaces/IRegistryCoordinator.sol";
import "../../src/interfaces/IStakeRegistry.sol";
import "../../src/interfaces/IRegistryCoordinator.sol";

/**
* @title Interface for a `Registry` that keeps track of stakes of operators for up to 256 quorums.
Expand Down
4 changes: 2 additions & 2 deletions test/unit/BLSApkRegistryUnit.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ pragma solidity =0.8.12;


import "forge-std/Test.sol";
import "test/harnesses/BLSApkRegistryHarness.sol";
import "test/mocks/RegistryCoordinatorMock.sol";
import "../harnesses/BLSApkRegistryHarness.sol";
import "../mocks/RegistryCoordinatorMock.sol";


contract BLSApkRegistryUnitTests is Test {
Expand Down
4 changes: 2 additions & 2 deletions test/unit/BLSSignatureCheckerUnit.t.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import "src/BLSSignatureChecker.sol";
import "test/utils/BLSMockAVSDeployer.sol";
import "../../src/BLSSignatureChecker.sol";
import "../utils/BLSMockAVSDeployer.sol";

contract BLSSignatureCheckerUnitTests is BLSMockAVSDeployer {
using BN254 for BN254.G1Point;
Expand Down
8 changes: 4 additions & 4 deletions test/unit/IndexRegistryUnit.t.sol
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.12;

import "src/interfaces/IIndexRegistry.sol";
import "src/IndexRegistry.sol";
import "test/mocks/RegistryCoordinatorMock.sol";
import "test/harnesses/BitmapUtilsWrapper.sol";
import "../../src/interfaces/IIndexRegistry.sol";
import "../../src/IndexRegistry.sol";
import "../mocks/RegistryCoordinatorMock.sol";
import "../harnesses/BitmapUtilsWrapper.sol";

import "forge-std/Test.sol";

Expand Down
5 changes: 3 additions & 2 deletions test/unit/RegistryCoordinatorUnit.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import "test/utils/MockAVSDeployer.sol";
import "../utils/MockAVSDeployer.sol";

contract RegistryCoordinatorUnit is MockAVSDeployer {
using BN254 for BN254.G1Point;
Expand Down Expand Up @@ -354,11 +354,13 @@ contract RegistryCoordinatorUnit is MockAVSDeployer {
stakeRegistry.setOperatorWeight(uint8(quorumNumbers[0]), defaultOperator, defaultStake);
cheats.prank(defaultOperator);
cheats.roll(registrationBlockNumber);

registryCoordinator.registerOperator(quorumNumbers, defaultSocket, pubkeyRegistrationParams, emptySig);

cheats.prank(defaultOperator);
cheats.roll(nextRegistrationBlockNumber);
cheats.expectRevert("RegistryCoordinator._registerOperator: operator already registered for some quorums being registered for");

registryCoordinator.registerOperator(quorumNumbers, defaultSocket, pubkeyRegistrationParams, emptySig);
}

Expand Down Expand Up @@ -597,7 +599,6 @@ contract RegistryCoordinatorUnit is MockAVSDeployer {

// re-register the operator
registryCoordinator.registerOperator(quorumNumbers, defaultSocket, pubkeyRegistrationParams, emptySig);

// check success of registration
uint256 quorumBitmap = BitmapUtils.orderedBytesArrayToBitmap(quorumNumbers);
assertEq(registryCoordinator.getOperatorId(defaultOperator), defaultOperatorId, "1");
Expand Down
Loading

0 comments on commit a79742b

Please sign in to comment.