Skip to content

Commit

Permalink
Merge branch 'Layr-Labs:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
bxue-l2 authored Apr 16, 2024
2 parents 9f1c3f7 + 6a50f91 commit 19cea9b
Show file tree
Hide file tree
Showing 18 changed files with 1,439 additions and 26 deletions.
2 changes: 1 addition & 1 deletion contracts/bindings/AVSDirectory/binding.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/bindings/BLSApkRegistry/binding.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/bindings/BN254/binding.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion contracts/bindings/BitmapUtils/binding.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion contracts/bindings/DelegationManager/binding.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/bindings/EigenDAServiceManager/binding.go

Large diffs are not rendered by default.

1,409 changes: 1,409 additions & 0 deletions contracts/bindings/EjectionManager/binding.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/bindings/IndexRegistry/binding.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/bindings/MockRollup/binding.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/bindings/OperatorStateRetriever/binding.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/bindings/RegistryCoordinator/binding.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/bindings/StakeRegistry/binding.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function create_binding {
forge clean
forge build

contracts="AVSDirectory DelegationManager BitmapUtils OperatorStateRetriever RegistryCoordinator BLSApkRegistry IndexRegistry StakeRegistry BN254 EigenDAServiceManager IEigenDAServiceManager MockRollup"
contracts="AVSDirectory DelegationManager BitmapUtils OperatorStateRetriever RegistryCoordinator BLSApkRegistry IndexRegistry StakeRegistry BN254 EigenDAServiceManager IEigenDAServiceManager MockRollup EjectionManager"
for contract in $contracts; do
create_binding ./ $contract ./bindings
done
Expand Down
2 changes: 1 addition & 1 deletion contracts/lib/eigenlayer-middleware
Submodule eigenlayer-middleware updated 73 files
+0 −3 .gitmodules
+24 −10 README.md
+6 −0 foundry.toml
+0 −1 lib/ds-test
+1 −1 lib/eigenlayer-contracts
+1 −1 lib/forge-std
+2 −2 script/ServiceManagerRouterDeploy.s.sol
+1 −1 src/BLSApkRegistry.sol
+1 −1 src/BLSApkRegistryStorage.sol
+1 −1 src/BLSSignatureChecker.sol
+182 −0 src/EjectionManager.sol
+1 −1 src/IndexRegistry.sol
+1 −1 src/IndexRegistryStorage.sol
+1 −1 src/OperatorStateRetriever.sol
+1 −1 src/RegistryCoordinator.sol
+2 −2 src/RegistryCoordinatorStorage.sol
+1 −1 src/ServiceManagerBase.sol
+2 −2 src/ServiceManagerRouter.sol
+1 −1 src/StakeRegistry.sol
+1 −1 src/StakeRegistryStorage.sol
+1 −1 src/interfaces/IBLSApkRegistry.sol
+1 −1 src/interfaces/IBLSSignatureChecker.sol
+55 −0 src/interfaces/IEjectionManager.sol
+2 −2 src/interfaces/IIndexRegistry.sol
+1 −1 src/interfaces/IRegistryCoordinator.sol
+1 −1 src/interfaces/ISocketUpdater.sol
+2 −2 src/interfaces/IStakeRegistry.sol
+1 −1 src/libraries/BN254.sol
+2 −2 src/libraries/BitmapUtils.sol
+1 −1 test/events/IBLSApkRegistryEvents.sol
+1 −1 test/events/IIndexRegistryEvents.sol
+2 −2 test/events/IStakeRegistryEvents.sol
+2 −2 test/ffi/BLSPubKeyCompendiumFFI.t.sol
+1 −1 test/ffi/BLSSignatureCheckerFFI.t.sol
+2 −2 test/ffi/UpdateOperators.t.sol
+1 −1 test/ffi/util/G2Operations.sol
+1 −1 test/harnesses/BLSApkRegistryHarness.sol
+1 −1 test/harnesses/BitmapUtilsWrapper.sol
+1 −1 test/harnesses/RegistryCoordinatorHarness.t.sol
+1 −1 test/harnesses/StakeRegistryHarness.sol
+1 −1 test/integration/CoreRegistration.t.sol
+2 −2 test/integration/IntegrationBase.t.sol
+2 −2 test/integration/IntegrationChecks.t.sol
+2 −2 test/integration/IntegrationConfig.t.sol
+2 −2 test/integration/IntegrationDeployer.t.sol
+3 −3 test/integration/TimeMachine.t.sol
+3 −3 test/integration/User.t.sol
+2 −2 test/integration/mocks/BeaconChainOracleMock.t.sol
+2 −2 test/integration/tests/Full_Register_Deregister.t.sol
+2 −2 test/integration/tests/NonFull_Register_CoreBalanceChange_Update.t.sol
+2 −2 test/integration/tests/NonFull_Register_Deregister.t.sol
+2 −2 test/integration/utils/BitmapStrings.t.sol
+2 −2 test/integration/utils/Sort.t.sol
+1 −1 test/mocks/AVSDirectoryMock.sol
+2 −2 test/mocks/DelegationMock.sol
+1 −1 test/mocks/RegistryCoordinatorMock.sol
+1 −1 test/mocks/ServiceManagerMock.sol
+1 −1 test/mocks/StakeRegistryMock.sol
+1 −1 test/unit/BLSApkRegistryUnit.t.sol
+1 −1 test/unit/BLSSignatureCheckerUnit.t.sol
+2 −2 test/unit/BitmapUtils.t.sol
+418 −0 test/unit/EjectionManagerUnit.t.sol
+2 −2 test/unit/OperatorStateRetrieverUnit.t.sol
+1 −1 test/unit/RegistryCoordinatorUnit.t.sol
+2 −2 test/unit/ServiceManagerRouter.t.sol
+1 −1 test/unit/StakeRegistryUnit.t.sol
+1 −1 test/unit/Utils.sol
+1 −1 test/utils/BLSMockAVSDeployer.sol
+2 −2 test/utils/MockAVSDeployer.sol
+1 −1 test/utils/Operators.sol
+1 −1 test/utils/Owners.sol
+1 −1 test/utils/ProofParsing.sol
+1 −1 test/utils/SignatureCompaction.sol
2 changes: 1 addition & 1 deletion contracts/script/DeployOpenEigenLayer.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import "forge-std/Test.sol";
// # To deploy and verify our contract
// forge script script/M1_Deploy.s.sol:Deployer_M1 --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast -vvvv
contract DeployOpenEigenLayer is Script, Test {
Vm cheats = Vm(HEVM_ADDRESS);
Vm cheats = Vm(VM_ADDRESS);

// struct used to encode token info in config file
struct StrategyConfig {
Expand Down
1 change: 1 addition & 0 deletions contracts/src/Imports.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
import "eigenlayer-middleware/OperatorStateRetriever.sol";
import "eigenlayer-middleware/BLSApkRegistry.sol";
import "eigenlayer-middleware/RegistryCoordinator.sol";
import "eigenlayer-middleware/EjectionManager.sol";
25 changes: 14 additions & 11 deletions encoding/kzg/verifier/verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,24 @@ func NewVerifier(config *kzg.KzgConfig, loadG2Points bool) (*Verifier, error) {
return nil, err
}
} else {
if len(config.G2PowerOf2Path) == 0 {
return nil, errors.New("G2PowerOf2Path is empty. However, object needs to load G2Points")
if len(config.G2PowerOf2Path) == 0 && len(config.G2Path) == 0 {
return nil, errors.New("both G2Path and G2PowerOf2Path are empty. However, object needs to load G2Points")
}

if config.SRSOrder == 0 {
return nil, errors.New("SRS order cannot be 0")
}

maxPower := uint64(math.Log2(float64(config.SRSOrder)))
_, err := kzg.ReadG2PointSection(config.G2PowerOf2Path, 0, maxPower, 1)
if err != nil {
return nil, fmt.Errorf("file located at %v is invalid", config.G2PowerOf2Path)
if len(config.G2PowerOf2Path) != 0 {
if config.SRSOrder == 0 {
return nil, errors.New("SRS order cannot be 0")
}

maxPower := uint64(math.Log2(float64(config.SRSOrder)))
_, err := kzg.ReadG2PointSection(config.G2PowerOf2Path, 0, maxPower, 1)
if err != nil {
return nil, fmt.Errorf("file located at %v is invalid", config.G2PowerOf2Path)
}
} else {
log.Println("verifier requires accesses to entire g2 points. It is a legacy usage. For most operators, it is likely because G2_POWER_OF_2_PATH is improperly configured.")
}
}

srs, err := kzg.NewSrs(s1, s2)
if err != nil {
log.Println("Could not create srs", err)
Expand Down

0 comments on commit 19cea9b

Please sign in to comment.