-
Notifications
You must be signed in to change notification settings - Fork 98
Signature aggregator binary #2829
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
base: main
Are you sure you want to change the base?
Conversation
sdk/blockchain/blockchain.go
Outdated
killExistingProcess := func() error { | ||
// Try pkill first | ||
cmd := exec.Command("pkill", "-f", "signature-aggregator") | ||
if err := cmd.Run(); err == nil { | ||
return nil | ||
} | ||
return nil | ||
} |
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.
do we want to reuse signature aggregator instances, or do we kill and restart each time? @felipemadero
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.
we want to reuse instances. there is bootstrapping time spent connecting to pchain which we would like to happens once.
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.
addressed
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.
this is a big improvement. I believe we need to target all signature aggregation needs now
@@ -215,17 +215,17 @@ var _ = ginkgo.Describe("[Validator Manager POA Set Up]", ginkgo.Ordered, func() | |||
BootstrapValidators: avaGoBootstrapValidators, | |||
} | |||
|
|||
ctx, cancel := utils.GetSignatureAggregatorContext() | |||
_, cancel := utils.GetSignatureAggregatorContext() |
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.
why do you call this if unused?
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.
addressed
sdk/blockchain/blockchain.go
Outdated
} | ||
|
||
binPath := filepath.Join(signatureAggregatorBinDir, "signature-aggregator-v0.4.3", "signature-aggregator") | ||
if _, err := interchain.StartSignatureAggregator(binPath, configPath, aggregatorLogger); err != nil { |
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.
what happen if a second L1 is deployed? does this aggregator dies? we need to be sure that:
- add validator, and such, also uses this aggregator
- a validator instance is started for any operation that requires aggregation
- if deploying many l1s, and on different networks, everything continues working (add validator, etc)
- we either need one aggregator that is reconfigured without lossing the previous conf, or many aggregator instances, first option is preferred
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.
it just updates the config and restarts the signature aggregator if second l1 is deployed
func StartSignatureAggregator(binPath string, configPath string, logger logging.Logger) (int, error) { | ||
// Function to check if port is in use | ||
isPortInUse := func() bool { | ||
conn, err := net.Dial("tcp", "localhost:8080") |
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.
- can we use a non standard port for the aggregator?
- can the port be in constants?
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.
addressed
// Try to start the aggregator with retries | ||
maxRetries := 3 | ||
for i := 0; i < maxRetries; i++ { | ||
if isPortInUse() { |
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.
i should not base on port, but on a conf file with PID that indicates if the aggregator is executing
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.
you can easily kill some other process with this method
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.
addressed
InfoAPI: APIConfig{BaseURL: networkEndpoint}, | ||
SignatureCacheSize: 1048576, | ||
AllowPrivateIPs: true, | ||
TrackedSubnetIDs: []string{subnetID}, |
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.
lets enabling reconfiguration to add more subnet IDs, and keep one aggregator for all L1s
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.
addressed
This PR changes the signature aggregator from a dependency to a standalone binary