Skip to content

Conversation

hopeyen
Copy link
Contributor

@hopeyen hopeyen commented Jun 26, 2025

Why are these changes needed?

Adds address directory support while maintaining backwards compatibility with legacy individual address configuration.

  • Address directory in all core services (node, churner, batcher, etc.)
  • Updates deployment scripts to include EigenDADirectory address output
  • Adds address directory support to test configurations and client examples
  • Implements proper validation requiring either address directory OR legacy addresses

Services that uses an Eth Client will now be taking eigendaDirectory address in configurations, instead of blsOperatorStateRetriever and eigenDAServiceManager.

Disperser API server, batcher, controller, dataapi, node cmd, node plugin, operator churner, relay, retriever, ejection tool, quorumscan, semvarscan, proxy client

eigenda-directory with each service's flag prefix

Checks

  • I've made sure the tests are passing. Note that there might be a few flaky tests, in that case, please comment that they are not relevant.
  • I've checked the new test coverage and the coverage percentage didn't drop.
  • Testing Strategy
    • Unit tests
    • Integration tests
    • This PR is not tested :(

@hopeyen hopeyen force-pushed the hope/integrate-address-directory branch 4 times, most recently from 2e39705 to 8d37186 Compare June 27, 2025 13:58
@hopeyen hopeyen changed the title feat: implement backwards-compatible address directory integration feat: eth client address directory Jun 27, 2025
@hopeyen hopeyen force-pushed the hope/integrate-address-directory branch 2 times, most recently from be772d1 to d4eb749 Compare June 27, 2025 19:46
- Add NewReaderWithAddressDirectory() for address directory-based initialization
- ContractNames constants matching AddressDirectoryConstants.sol
- optional AddressDirectoryFlag, BlsOperatorStateRetrieverFlag, and EigenDAServiceManagerFlag
- validation to require either address directory OR both legacy flags
- backward compatibility for existing deployments without address directory
@hopeyen hopeyen force-pushed the hope/integrate-address-directory branch from d4eb749 to cf716c1 Compare June 27, 2025 20:17
@hopeyen hopeyen marked this pull request as ready for review June 27, 2025 20:53
@hopeyen hopeyen requested review from pakim249CAL and a team as code owners June 27, 2025 20:53
@hopeyen hopeyen requested review from anupsv and dmanc June 27, 2025 20:53
@hopeyen hopeyen force-pushed the hope/integrate-address-directory branch 3 times, most recently from 72aa96a to af2f194 Compare June 27, 2025 22:11
@hopeyen hopeyen force-pushed the hope/integrate-address-directory branch from af2f194 to 2a9ba2d Compare June 27, 2025 22:12
Copy link
Collaborator

@samlaf samlaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have we thought through the consequences of using a dynamic lookup system like the AddressRegistry (as opposed to hardcoded addresses)? Does it have the exact same behavior as the current strategy of reading from serviceManager pointers?

I guess the thing I'm unsure is... would a contractAddress in the addressRegistry ever change in place? If so, what are the conditions for this/when would we want to do this? If this can happen, then can't you run into a situation where the address changes, the binary crashes, gets restarted and loads from a new contract address, but this new contract then has a breaking api change, and the (hardcoded) bindings then don't work. How do we prevent this from happening?

@pakim249CAL
Copy link
Contributor

pakim249CAL commented Jun 30, 2025

Have we thought through the consequences of using a dynamic lookup system like the AddressRegistry (as opposed to hardcoded addresses)? Does it have the exact same behavior as the current strategy of reading from serviceManager pointers?

What behaviors are you looking for here? When will it not be enough to just replace a service manager pointer with this one?

I guess the thing I'm unsure is... would a contractAddress in the addressRegistry ever change in place? If so, what are the conditions for this/when would we want to do this? If this can happen, then can't you run into a situation where the address changes, the binary crashes, gets restarted and loads from a new contract address, but this new contract then has a breaking api change, and the (hardcoded) bindings then don't work. How do we prevent this from happening?

Address changes should happen with communication, just like any contract upgrade. It will be owned by the DA ops multisig. In that sense, it should be handled the same way as any contract upgrade would be. This mechanism allows us to reduce the technical load of doing upgrades.

@hopeyen hopeyen force-pushed the hope/integrate-address-directory branch from 95291db to 23bbb80 Compare June 30, 2025 17:42
Copy link

github-actions bot commented Jul 1, 2025

The latest Buf updates on your PR. Results from workflow Buf Proto / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedJul 1, 2025, 8:32 PM

litt3
litt3 previously approved these changes Jul 2, 2025
@@ -29,6 +29,7 @@ var (
)
ServiceManagerAddrFlagName = withFlagPrefix("service-manager-addr")
BLSOperatorStateRetrieverFlagName = withFlagPrefix("bls-operator-state-retriever-addr")
EigenDADirectoryFlagName = withFlagPrefix("eigen-da-directory")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you used eigen-da-directory here, but the other flags are named eigenda-directory,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated 1ea1ff4

disperserHostname = "disperser-testnet-holesky.eigenda.xyz"

// Eth client
addressDirectoryAddress = "0x90776Ea0E99E4c38aA1Efe575a61B3E40160A2FE"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here is another case where the term "address directory" is used, instead of "EigenDA Directory"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


// AddressDirectoryReader wraps the address directory contract and provides
// safe getters for contract addresses with zero address validation
type AddressDirectoryReader struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This struct and file name use "address directory" terminology, instead of "EigenDA Directory"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -65,21 +68,37 @@ var _ core.Reader = (*Reader)(nil)
func NewReader(
logger logging.Logger,
client common.EthClient,
blsOperatorStateRetrieverHexAddr string,
eigenDAServiceManagerHexAddr string) (*Reader, error) {
addressDirectoryHexAddr string) (*Reader, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here is another case where the term "address directory" is used, instead of "EigenDA Directory"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -37,12 +37,11 @@ var _ core.Writer = (*Writer)(nil)
func NewWriter(
logger logging.Logger,
client common.EthClient,
blsOperatorStateRetrieverHexAddr string,
eigenDAServiceManagerHexAddr string) (*Writer, error) {
addressDirectoryHexAddr string) (*Writer, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here is another case where the term "address directory" is used, instead of "EigenDA Directory"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -204,7 +204,7 @@ func TestChurner(t *testing.T) {
assert.NoError(t, err)
}

func createTransactorFromScratch(privateKey, operatorStateRetriever, serviceManager string, logger logging.Logger) (*eth.Writer, error) {
func createTransactorFromScratch(privateKey, addressDirectory string, logger logging.Logger) (*eth.Writer, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here is another case where the term "address directory" is used, instead of "EigenDA Directory"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usage: "Address of the Eigen DA service manager",
Required: true,
EnvVar: common.PrefixEnvVar(envVarPrefix, "EIGEN_DA_SERVICE_MANAGER_ADDR"),
AddressDirectoryFlag = cli.StringFlag{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here is another case where the term "address directory" is used, instead of "EigenDA Directory"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pakim249CAL
pakim249CAL previously approved these changes Jul 2, 2025
Comment on lines 30 to 31
ServiceManagerAddrFlagName = withFlagPrefix("service-manager-addr")
BLSOperatorStateRetrieverFlagName = withFlagPrefix("bls-operator-state-retriever-addr")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think we should mark these as deprecated and hint people to start moving to the eigenda-directory? Prob want to do it across all of our services (apiserver, nodes, etc). Everything in this PR. And eventually we'll remove all other address flags and only keep the eigenda-directory.

not sure if urfave has a way to mark flags as deprecated. If not then we might need to manually log a warn. cc @dmanc who will be updating our helm charts to use these new flags. Can you also add this as a note to this PR description? This kind of external config changes are very important to highlight.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i made a linear ticket for proxy, and for all services ticket. I will add notes to the PR description

Copy link
Collaborator

@samlaf samlaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make the binaries backwards compatible again by keeping the old ServiceManager flag around, and allowing binaries to be started with those flags. We don't want to break people.

Comment on lines 35 to 39
BlsOperatorStateRetrieverFlag = cli.StringFlag{
Name: common.PrefixFlag(FlagPrefix, "bls-operator-state-retriever"),
Usage: "Address of the BLS Operator State Retriever",
Required: true,
EnvVar: common.PrefixEnvVar(envPrefix, "BLS_OPERATOR_STATE_RETRIVER"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't remove this flag, since thats a breaking change. instead mark it as deprecated and log a warning when its used, prompting the user to use the new flags.

}
// This flag is kept for retriever's fetchBatchHeader; can later be removed by utilizing AddressDirectoryFlag
EigenDAServiceManagerFlag = cli.StringFlag{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you didn't add the flag back, just the config. let's not delete flags until we're ready for the breaking change (which should be announced in advance).

Comment on lines 205 to 215
BlsOperatorStateRetrieverAddrFlag = cli.StringFlag{
Name: common.PrefixFlag(FlagPrefix, "bls-operator-state-retriever-addr"),
Usage: "Address of the BLS operator state retriever",
Required: true,
EnvVar: common.PrefixEnvVar(envVarPrefix, "BLS_OPERATOR_STATE_RETRIEVER_ADDR"),
}
EigenDAServiceManagerAddrFlag = cli.StringFlag{
Name: common.PrefixFlag(FlagPrefix, "eigen-da-service-manager-addr"),
Usage: "Address of the Eigen DA service manager",
Required: true,
EnvVar: common.PrefixEnvVar(envVarPrefix, "EIGEN_DA_SERVICE_MANAGER_ADDR"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add these flags back, we don't want to create breaking changes. Every binary should be backwards compatible with these old flags. you can mark them as deprecated but not delete.

Name: common.PrefixFlag(FlagPrefix, "eigenda-directory"),
Usage: "Address of the EigenDA Address Directory",
Required: false,
EnvVar: common.PrefixEnvVar(envPrefix, "EIGENDA_DIRECTORY"),
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont delete these flags. see my other comments.

Comment on lines 159 to 169
BlsOperatorStateRetrieverFlag = cli.StringFlag{
Name: common.PrefixFlag(FlagPrefix, "bls-operator-state-retriever"),
Usage: "Address of the BLS Operator State Retriever",
Required: true,
EnvVar: common.PrefixEnvVar(EnvVarPrefix, "BLS_OPERATOR_STATE_RETRIVER"),
}
EigenDAServiceManagerFlag = cli.StringFlag{
Name: common.PrefixFlag(FlagPrefix, "eigenda-service-manager"),
Usage: "Address of the EigenDA Service Manager",
Required: true,
EnvVar: common.PrefixEnvVar(EnvVarPrefix, "EIGENDA_SERVICE_MANAGER"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please do not ever do this. this will break users and they will scream at us. flag breaking changes should be announced way ahead of time, and should have been deprecated for a while, and any PRs removing flags (breaking API change!) should have its title with an ! like feat!: eth client address directory to mark the breaking change (to be clear we should not do this right now, but the ! is useful to flag to the release captain that a MAJOR version bump is needed)

@samlaf
Copy link
Collaborator

samlaf commented Jul 3, 2025

Please make the binaries backwards compatible again by keeping the old ServiceManager flag around, and allowing binaries to be started with those flags. We don't want to break people.

@hopeyen and I chatted offline. I'm very very sorry, as I caused a lot of churn and back-and-forth on this one, initially requesting that the flags be deleted, and later on realizing this was not good. Mea culpa 😭

Let's discuss during next week's ReleaseMgmt meeting how we want to deal with config changes wrt breaking changes:

  1. are we ok with removing flags (which will cause binaries to crash with an uninformative msg if the old flag is still used)?
  2. if not are we ok with making new flags required (this is also technically a breaking change requiring a MAJOR bump update, but at least its easier for devops person running the binary to fix since they get a nice error msg requesting a new flag to be present)
  3. otherwise we have to keep old flags around with a deprecated warning notice. Also need to discuss the policy around how long before we are OK with removing (and only then bumping the MAJOR version).

samlaf
samlaf previously approved these changes Jul 3, 2025
Copy link
Collaborator

@samlaf samlaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except for the wording of the deprecated notice. Please change everywhere and then we can merge.

registryCoordinatorAddress = "0x53012C69A189cfA2D9d29eb6F19B32e0A2EA3490"
blsOperatorStateRetrieverAddress = "0x003497Dd77E5B73C40e8aCbB562C8bb0410320E7"
eigenDAServiceManagerAddress = "0xD4A7E1Bd8015057293f0D0A557088c286942e84b"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: examples should use SOTA stuff, so should only use the eigendaDirectoryAddress.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blsOperatorStateRetrieverAddress is still used for CertBuilder, that's not changed within this PR.
I will update eigenDAServiceManagerAddress to an empty string because new EthClient take all three arguments

@@ -119,18 +119,25 @@ func CLIFlags(envPrefix, category string) []cli.Flag {
},
&cli.StringFlag{
Name: ServiceManagerAddrFlagName,
Usage: "Address of the EigenDA service manager contract.",
Usage: "[Deprecating soon in favor of EigenDADirectory] Address of the EigenDA Service Manager contract.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Usage: "[Deprecating soon in favor of EigenDADirectory] Address of the EigenDA Service Manager contract.",
Usage: "[Deprecated: use EigenDADirectory instead] Address of the EigenDA Service Manager contract.",

EnvVars: []string{withEnvPrefix(envPrefix, "BLS_OPERATOR_STATE_RETRIEVER_ADDR")},
Category: category,
Required: false,
},
&cli.StringFlag{
Name: EigenDADirectoryFlagName,
Usage: "Address of the EigenDA directory contract.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Usage: "Address of the EigenDA directory contract.",
Usage: "Address of the EigenDA directory contract, which points to all other EigenDA contract addresses. This is the only contract entrypoint needed offchain.",

@@ -48,14 +48,14 @@ var (
}
BlsOperatorStateRetrieverFlag = cli.StringFlag{
Name: common.PrefixFlag(FlagPrefix, "bls-operator-state-retriever"),
Usage: "Address of the BLS Operator State Retriever",
Required: true,
Usage: "[Deprecating soon in favor of EigenDADirectory] Address of the BLS operator state Retriever",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Usage: "[Deprecating soon in favor of EigenDADirectory] Address of the BLS operator state Retriever",
Usage: "[Deprecated: use EigenDADirectory instead] Address of the BLS operator state Retriever",

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is already deprecated. Deprecated means there's a better way to do things and we're giving you some time to switch over to the new method before we delete this old method.

It's already deprecated, and will eventually get deleted. But better not to use relative language like "soon" or "eventually" because thats fuzzy and unuseful.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plesae change everywhere

@hopeyen hopeyen merged commit 2882c13 into master Jul 3, 2025
47 of 48 checks passed
@hopeyen hopeyen deleted the hope/integrate-address-directory branch July 3, 2025 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants