Layr-Labs / eigensdk-go

Go SDK for building AVSs on Eigenlayer
https://www.eigenlayer.xyz/
Other
61 stars 41 forks source link

Add an option for ```NewOperatorsInfoServiceInMemory``` to start scanning from a given block #259

Closed MauroToscano closed 3 days ago

MauroToscano commented 3 months ago

NewOperatorsInfoServiceInMemory takes too much time to initialize.

It could start scanning the blockchain from some arbitrary block. QueryExistingRegisteredOperatorPubKeys already provides that option.

samlaf commented 1 month ago

Hey @MauroToscano sorry forgot to answer this.

This is definitely needed. I already added startBlock params to the avsreader methods: https://github.com/Layr-Labs/eigensdk-go/blob/4b1bb2a86e2acc0de02952b5a20de1aa5eaaf746/chainio/clients/avsregistry/reader.go#L76

Would just need to update the call to them in the blsagg service: https://github.com/Layr-Labs/eigensdk-go/blob/4b1bb2a86e2acc0de02952b5a20de1aa5eaaf746/services/operatorsinfo/operatorsinfo_inmemory.go#L180 that is currently passing nil (aka start from block 0).