Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor avs registry #283

Merged

Conversation

shrimalmadhur
Copy link
Collaborator

Fixes # .

What Changed?

  • Refactor using config
  • Change interface naming ( a breaking change sadly)

Reviewer Checklist

  • Code is well-documented
  • Code adheres to Go naming conventions
  • Code deprecates any old functionality before removing it

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.

nit comments

Comment on lines +28 to +29
DelegationManagerAddr gethcommon.Address
AvsDirectoryAddr gethcommon.Address
Copy link
Collaborator

Choose a reason for hiding this comment

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

why add el contracts here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

coz avsregistry/writer.go needs elReader contract.

Comment on lines 131 to 138
var serviceManagerAddr gethcommon.Address
var registryCoordinatorAddr gethcommon.Address
var stakeRegistryAddr gethcommon.Address
var blsApkRegistryAddr gethcommon.Address
var indexRegistryAddr gethcommon.Address
var operatorStateRetrieverAddr gethcommon.Address
var delegationManagerAddr gethcommon.Address
var avsDirectoryAddr gethcommon.Address
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
var serviceManagerAddr gethcommon.Address
var registryCoordinatorAddr gethcommon.Address
var stakeRegistryAddr gethcommon.Address
var blsApkRegistryAddr gethcommon.Address
var indexRegistryAddr gethcommon.Address
var operatorStateRetrieverAddr gethcommon.Address
var delegationManagerAddr gethcommon.Address
var avsDirectoryAddr gethcommon.Address
var (
serviceManagerAddr gethcommon.Address
registryCoordinatorAddr gethcommon.Address
stakeRegistryAddr gethcommon.Address
blsApkRegistryAddr gethcommon.Address
indexRegistryAddr gethcommon.Address
operatorStateRetrieverAddr gethcommon.Address
delegationManagerAddr gethcommon.Address
avsDirectoryAddr gethcommon.Address
)

client,
)
if err != nil {
return nil, utils.WrapError("Failed to fetch ServiceManager contract", err)
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
return nil, utils.WrapError("Failed to fetch ServiceManager contract", err)
return nil, utils.WrapError("Failed to create ServiceManager contract", err)

client,
)
if err != nil {
return nil, utils.WrapError("Failed to fetch StakeRegistry contract", err)
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
return nil, utils.WrapError("Failed to fetch StakeRegistry contract", err)
return nil, utils.WrapError("Failed to create StakeRegistry contract", err)

client,
)
if err != nil {
return nil, utils.WrapError("Failed to fetch BLSPubkeyRegistry contract", err)
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
return nil, utils.WrapError("Failed to fetch BLSPubkeyRegistry contract", err)
return nil, utils.WrapError("Failed to create BLSPubkeyRegistry contract", err)

) *AvsRegistryChainReader {
return &AvsRegistryChainReader{
) *ChainReader {
logger = logger.With("module", "avsregistry/ChainReader")
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's create a logger.sublogger("avsregistry/ChainReader") function which automatically adds the "module" tag? Otherwise we might end up with people using different keys in different subloggers

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good call.

@samlaf samlaf force-pushed the madhur-elo-200-refactor-avs-registry-similar-to-elcontracts branch from 350bc45 to 06e6a0b Compare June 28, 2024 23:38
@samlaf samlaf merged commit 80be44e into dev Jun 28, 2024
4 checks passed
@samlaf samlaf deleted the madhur-elo-200-refactor-avs-registry-similar-to-elcontracts branch June 28, 2024 23:52
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.

2 participants