Skip to content

Commit

Permalink
add middleware bindings changes
Browse files Browse the repository at this point in the history
  • Loading branch information
shrimalmadhur committed Jan 2, 2025
1 parent 2e1a034 commit 91f5b7b
Show file tree
Hide file tree
Showing 15 changed files with 2,337 additions and 742 deletions.
7 changes: 7 additions & 0 deletions chainio/clients/avsregistry/bindings.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type ContractBindings struct {
IndexRegistryAddr gethcommon.Address
DelegationManagerAddr gethcommon.Address
AvsDirectoryAddr gethcommon.Address
AllocationManagerAddr gethcommon.Address
// contract bindings
ServiceManager *servicemanager.ContractServiceManagerBase
RegistryCoordinator *regcoordinator.ContractRegistryCoordinator
Expand Down Expand Up @@ -136,6 +137,7 @@ func NewBindingsFromConfig(
indexRegistryAddr gethcommon.Address
delegationManagerAddr gethcommon.Address
avsDirectoryAddr gethcommon.Address
allocationManagerAddr gethcommon.Address

contractBlsRegistryCoordinator *regcoordinator.ContractRegistryCoordinator
contractServiceManager *servicemanager.ContractServiceManagerBase
Expand Down Expand Up @@ -209,6 +211,10 @@ func NewBindingsFromConfig(
if err != nil {
return nil, utils.WrapError("Failed to get AvsDirectory address", err)
}
allocationManagerAddr, err = contractServiceManager.AllocationManager(&bind.CallOpts{})
if err != nil {
return nil, utils.WrapError("Failed to get AllocationManager address", err)
}
}

if isZeroAddress(cfg.OperatorStateRetrieverAddress) {
Expand All @@ -233,6 +239,7 @@ func NewBindingsFromConfig(
OperatorStateRetrieverAddr: cfg.OperatorStateRetrieverAddress,
DelegationManagerAddr: delegationManagerAddr,
AvsDirectoryAddr: avsDirectoryAddr,
AllocationManagerAddr: allocationManagerAddr,
ServiceManager: contractServiceManager,
RegistryCoordinator: contractBlsRegistryCoordinator,
StakeRegistry: contractStakeRegistry,
Expand Down
32 changes: 31 additions & 1 deletion chainio/clients/avsregistry/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,37 @@ func (w *ChainWriter) DeregisterOperator(
if err != nil {
return nil, err
}
tx, err := w.registryCoordinator.DeregisterOperator(noSendTxOpts, quorumNumbers.UnderlyingType())
tx, err := w.registryCoordinator.DeregisterOperator0(noSendTxOpts, quorumNumbers.UnderlyingType())
if err != nil {
return nil, err
}
receipt, err := w.txMgr.Send(ctx, tx, waitForReceipt)
if err != nil {
return nil, errors.New("failed to send tx with err: " + err.Error())
}
w.logger.Info(
"successfully deregistered operator with the AVS's registry coordinator",
"txHash",
receipt.TxHash.String(),
)
return receipt, nil
}

func (w *ChainWriter) DeregisterOperatorOperatorSets(
ctx context.Context,
operatorSetIds types.OperatorSetIds,
operator types.Operator,
pubkey regcoord.BN254G1Point,
waitForReceipt bool,
) (*gethtypes.Receipt, error) {
w.logger.Info("deregistering operator with the AVS's registry coordinator")

operatorAddress := gethcommon.HexToAddress(operator.Address)
noSendTxOpts, err := w.txMgr.GetNoSendTxOpts()
if err != nil {
return nil, err
}
tx, err := w.registryCoordinator.DeregisterOperator(noSendTxOpts, operatorAddress, operatorSetIds.UnderlyingType())
if err != nil {
return nil, err
}
Expand Down
55 changes: 28 additions & 27 deletions chainio/clients/eigenpod/bindings/IEigenPod.go

Large diffs are not rendered by default.

440 changes: 210 additions & 230 deletions chainio/clients/eigenpod/bindings/IEigenPodManager.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion chainio/clients/eigenpod/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cleanup_bindings_dir() {

clone() {
echo "Cloning the EigenLayer contracts repository"
git clone -b feat/partial-withdrawal-batching --depth=1 git@github.com:Layr-Labs/eigenlayer-contracts.git "${TMP_DIR}"
git clone -b slashing-magnitudes --depth=1 git@github.com:Layr-Labs/eigenlayer-contracts.git "${TMP_DIR}"
}

generate_bindings() {
Expand Down
2 changes: 1 addition & 1 deletion contracts/anvil/contracts-deployed-anvil-state.json

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/ContractsRegistry/binding.go

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

Loading

0 comments on commit 91f5b7b

Please sign in to comment.