Skip to content

Commit

Permalink
Enable batcher to confirm
Browse files Browse the repository at this point in the history
  • Loading branch information
mooselumph committed Jan 19, 2024
1 parent 581f7b5 commit de0dc26
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
1 change: 1 addition & 0 deletions contracts/script/EigenDADeployer.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ contract EigenDADeployer is DeployOpenEigenLayer {
address eigenDAPauser;
address churner;
address ejector;
address confirmer;
}

function _deployEigenDAAndEigenLayerContracts(
Expand Down
6 changes: 6 additions & 0 deletions contracts/script/SetUpEigenDA.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ contract SetupEigenDA is EigenDADeployer, EigenLayerUtils {
addressConfig.eigenDAPauser = msg.sender;
addressConfig.churner = msg.sender;
addressConfig.ejector = msg.sender;
addressConfig.confirmer = msg.sender;

uint256 initialSupply = 1000 ether;
address tokenOwner = msg.sender;
Expand All @@ -65,6 +66,9 @@ contract SetupEigenDA is EigenDADeployer, EigenLayerUtils {
maxOperatorCount = stdJson.readUint(config_data, ".maxOperatorCount");
}


addressConfig.confirmer = vm.addr(stdJson.readUint(config_data, ".confirmerPrivateKey"));


vm.startBroadcast();

Expand All @@ -75,6 +79,8 @@ contract SetupEigenDA is EigenDADeployer, EigenLayerUtils {
tokenOwner,
maxOperatorCount
);

eigenDAServiceManager.setBatchConfirmer(addressConfig.confirmer);

vm.stopBroadcast();
}
Expand Down
5 changes: 5 additions & 0 deletions inabox/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ new-anvil:
mkdir -p "testdata/$(dt)"
cp ./templates/testconfig-anvil.yaml "testdata/$(dt)/config.yaml"

new-anvil-nochurner:
mkdir -p "testdata/$(dt)"
cp ./templates/testconfig-anvil-nochurner.yaml "testdata/$(dt)/config.yaml"


new-docker-anvil:
mkdir -p "testdata/$(dt)"
cp ./templates/testconfig-anvil-docker.yaml "testdata/$(dt)/config.yaml"
Expand Down
10 changes: 6 additions & 4 deletions inabox/deploy/config_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ type EigenDADeployConfig struct {
NumStrategies int `json:"numStrategies"`
MaxOperatorCount int `json:"maxOperatorCount"`
StakerPrivateKeys []string `json:"stakerPrivateKeys"`
ConfirmerPrivateKey string `json:"confirmerPrivateKey"`
StakerTokenAmounts [][]string `json:"-"`
OperatorPrivateKeys []string `json:"-"`
}
Expand All @@ -79,10 +80,11 @@ func (cfg *EigenDADeployConfig) MarshalJSON() ([]byte, error) {

// Marshal the remaining fields
remainingFields := map[string]interface{}{
"useDefaults": cfg.UseDefaults,
"numStrategies": cfg.NumStrategies,
"maxOperatorCount": cfg.MaxOperatorCount,
"stakerPrivateKeys": cfg.StakerPrivateKeys,
"useDefaults": cfg.UseDefaults,
"numStrategies": cfg.NumStrategies,
"maxOperatorCount": cfg.MaxOperatorCount,
"stakerPrivateKeys": cfg.StakerPrivateKeys,
"confirmerPrivateKey": cfg.ConfirmerPrivateKey,
}

remainingJSON, err := json.Marshal(remainingFields)
Expand Down
3 changes: 2 additions & 1 deletion inabox/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func (env *Config) generateEigenDADeployConfig() EigenDADeployConfig {
StakerPrivateKeys: stakers,
StakerTokenAmounts: stakes,
OperatorPrivateKeys: operators,
ConfirmerPrivateKey: env.getKeyString("batcher0"),
}

return config
Expand Down Expand Up @@ -219,7 +220,7 @@ func (env *Config) RunNodePluginBinary(operation string, operator OperatorVars)
"NODE_CHURNER_URL=" + operator.NODE_CHURNER_URL,
"NODE_NUM_CONFIRMATIONS=0",
}

err := execCmd("./node-plugin.sh", []string{}, envVars)

if err != nil {
Expand Down

0 comments on commit de0dc26

Please sign in to comment.