Merge branch 'master' into cel2

This commit is contained in:
Mohamed Sohail 2025-07-02 13:13:00 +03:00
commit dd663ba921
Signed by: kamikazechaser
GPG Key ID: 7DD45520C01CD85D

View File

@ -22,8 +22,9 @@ func bootstrapCache(
lo *slog.Logger,
) error {
var (
tokenRegistryGetter = w3.MustNewFunc("tokenRegistry()", "address")
quoterGetter = w3.MustNewFunc("quoter()", "address")
tokenRegistryGetter = w3.MustNewFunc("tokenRegistry()", "address")
quoterGetter = w3.MustNewFunc("quoter()", "address")
systemAcccountGetter = w3.MustNewFunc("systemAccount()", "address")
)
ctx, cancel := context.WithTimeout(context.Background(), time.Minute*5)
@ -46,6 +47,23 @@ func bootstrapCache(
}
}
if custodialRegistrationProxy := registryMap[ethutils.CustodialProxy]; custodialRegistrationProxy != ethutils.ZeroAddress {
var systemAccount common.Address
err := chain.Provider().Client.CallCtx(
ctx,
eth.CallFunc(custodialRegistrationProxy, systemAcccountGetter).Returns(&systemAccount),
)
if err != nil {
return err
}
if systemAccount != ethutils.ZeroAddress {
if err := cache.Add(ctx, systemAccount.Hex()); err != nil {
return err
}
lo.Debug("cached custodial system account", "address", systemAccount.Hex())
}
}
if accountIndex := registryMap[ethutils.AccountIndex]; accountIndex != ethutils.ZeroAddress {
if err := cache.Add(ctx, accountIndex.Hex()); err != nil {
return err
@ -103,7 +121,6 @@ func bootstrapCache(
if err := cache.Add(ctx, address.Hex()); err != nil {
return err
}
}
}
lo.Debug("cached token index batch", "batch_size", len(tokenIndexBatch))