-
Notifications
You must be signed in to change notification settings - Fork 195
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
Disperser auth innabox #1052
Disperser auth innabox #1052
Changes from 106 commits
0936f5f
d36424e
342d500
fd2ab69
e2e3fef
4373095
df38980
d54c7f7
083d67d
0a5c91a
8e9c16b
f348550
01b7ece
e09a77c
290c93c
5ba4b7b
e094371
db0885a
da2ca6c
b04fcfa
29e7e7d
fb1ebfb
6ca7c9b
3348883
e5966f0
f28a5d4
f0c6f4e
6a00256
27d5b8a
bbd82ec
157c2ea
d793501
b81e430
7327db1
8cfa971
306746e
b41d729
d709520
2e44b02
aebda81
260bf79
dbd0d24
5dbb178
dcd3e06
11cf45a
3580bed
f6b008f
1493ded
feab7a1
52f2354
7c5cc93
c83db79
e5cb69c
20216c4
3c325ef
d4b7051
02ed38a
60ad5c9
8560b8b
613bd20
4912547
80c7e6d
2b6cbb2
a9155a0
3a9792c
a57140c
11e2ffa
ad89396
a2b602e
db018f0
d1ac4a8
822ab3d
ee262bc
262e1a9
d32d0a8
1f42f9d
7caac2c
20fd4da
b09a43e
6f9e242
0a3e35b
d92252d
524b22a
7971b13
e07b734
8452d09
987b26c
525e37f
87a7610
3852dc7
a305e93
568e971
c77e596
7371497
eca25b9
26ec866
76efb7a
afe242f
4419be1
09b14ce
cd1bfc6
35caefb
7355080
6abb354
6003a89
8cbdd60
cba0358
57abb29
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,9 @@ import ( | |
"encoding/hex" | ||
"encoding/json" | ||
"fmt" | ||
"github.com/Layr-Labs/eigenda/api" | ||
contractEigenDADisperserRegistry "github.com/Layr-Labs/eigenda/contracts/bindings/EigenDADisperserRegistry" | ||
"log" | ||
"math/big" | ||
|
||
"github.com/Layr-Labs/eigenda/api/grpc/churner" | ||
|
@@ -329,3 +332,39 @@ func (t *Writer) ConfirmBatch(ctx context.Context, batchHeader *core.BatchHeader | |
} | ||
return receipt, nil | ||
} | ||
|
||
// SetDisperserAddress sets the address of the disperser. Since there is currently only one disperser, this function | ||
// can only be used to set the address of that disperser. | ||
func (t *Writer) SetDisperserAddress(ctx context.Context, address gethcommon.Address) error { | ||
registry := t.bindings.DisperserRegistry | ||
if registry == nil { | ||
log.Printf("disperser registry not deployed") | ||
return errors.New("disperser registry not deployed") | ||
} | ||
|
||
log.Printf("Setting disperser %d address to %s", api.EigenLabsDisperserID, address.String()) | ||
|
||
options, err := t.ethClient.GetNoSendTransactOpts() | ||
if err != nil { | ||
t.logger.Error("Failed to generate transact opts", "err", err) | ||
return err | ||
} | ||
options.Context = ctx | ||
|
||
transaction, err := registry.SetDisperserInfo( | ||
options, | ||
api.EigenLabsDisperserID, | ||
contractEigenDADisperserRegistry.DisperserInfo{ | ||
DisperserAddress: address, | ||
}) | ||
if err != nil { | ||
return fmt.Errorf("failed to create transaction for setting disperser address: %w", err) | ||
} | ||
|
||
err = t.ethClient.SendTransaction(ctx, transaction) | ||
if err != nil { | ||
return fmt.Errorf("failed to set disperser address: %w", err) | ||
} | ||
|
||
return nil | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this need to wait for txn to be mined? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added a retry loop in the function that calls this function. It will now wait for up to a minute if the disperser address is not available on chain.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This caused errors. I initially tried to use this method, but later in the test run I'd get failures with the following error message:
I spent a lot of time on this and was never able to determine how these two things were related. But as soon as I switched to using |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use lowecase for alias
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed to
dreg