Skip to content

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

Open
wants to merge 61 commits into
base: main
Choose a base branch
from
Open

Signature aggregator binary #2829

wants to merge 61 commits into from

Conversation

sukantoraymond
Copy link
Collaborator

This PR changes the signature aggregator from a dependency to a standalone binary

Comment on lines 498 to 505
killExistingProcess := func() error {
// Try pkill first
cmd := exec.Command("pkill", "-f", "signature-aggregator")
if err := cmd.Run(); err == nil {
return nil
}
return nil
}
Copy link
Collaborator Author

@sukantoraymond sukantoraymond Jun 3, 2025

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

Copy link
Collaborator

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

addressed

Copy link
Collaborator

@felipemadero felipemadero left a 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()
Copy link
Collaborator

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

addressed

}

binPath := filepath.Join(signatureAggregatorBinDir, "signature-aggregator-v0.4.3", "signature-aggregator")
if _, err := interchain.StartSignatureAggregator(binPath, configPath, aggregatorLogger); err != nil {
Copy link
Collaborator

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:

  1. add validator, and such, also uses this aggregator
  2. a validator instance is started for any operation that requires aggregation
  3. if deploying many l1s, and on different networks, everything continues working (add validator, etc)
  4. we either need one aggregator that is reconfigured without lossing the previous conf, or many aggregator instances, first option is preferred

Copy link
Collaborator Author

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")
Copy link
Collaborator

Choose a reason for hiding this comment

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

  1. can we use a non standard port for the aggregator?
  2. can the port be in constants?

Copy link
Collaborator Author

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() {
Copy link
Collaborator

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

Copy link
Collaborator

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

Copy link
Collaborator Author

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},
Copy link
Collaborator

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

addressed

@ava-labs ava-labs deleted a comment from felipemadero Jun 11, 2025
@ava-labs ava-labs deleted a comment from felipemadero Jun 11, 2025
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