Skip to content

fix: allow indexers from registering multiple times to set registration params #1215

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

Merged
merged 2 commits into from
Aug 22, 2025

Conversation

tmigone
Copy link
Member

@tmigone tmigone commented Aug 18, 2025

Problem
The SubgraphService contract only allows indexers to register once. This is achieved by reverting calls to the register() function if the indexer has indexer.registeredAt != 0. The idea behind this limitation is that registering is a "sign up" type of event that should only happen once for any given indexer.

This in itself does not create problems. However register() is the only function that allows setting the indexer's url and geoHash, meaning that those cannot be changed once the indexer is registered. Since there is no unregister() this means that an indexer would be locked forever with the url and geoHash they initially registered with.

Fix
The proposed fix:

  • Eliminates the indexer.registeredAt !=0 check, allowing indexers to repeatedly call register() to set the url, geoHash (and paymentsDestination). This puts the SubgraphService's behavior in line with the legacy ServiceRegistry.
  • Eliminates the registeredAt property from the indexer struct. It was only being used to verify if an indexer was registered. The same behavior can be achieved by testing the url or geohash length, as the contract would not allow setting them to a 0 length string.

@tmigone tmigone requested review from Maikol and pcarranzav August 18, 2025 17:55
@tmigone tmigone changed the title fix: allow indexers from registering multiple times to set registrati… fix: allow indexers from registering multiple times to set registration params Aug 18, 2025
Copy link

openzeppelin-code bot commented Aug 18, 2025

fix: allow indexers from registering multiple times to set registration params

Generated at commit: b8f84aed856699f79fc79824f5520474ebcb7f26

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
2
4
0
15
39
60
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

Copy link

codecov bot commented Aug 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.84%. Comparing base (4689fec) to head (b8f84ae).
⚠️ Report is 16 commits behind head on horizon.

Additional details and impacted files
@@           Coverage Diff            @@
##           horizon    #1215   +/-   ##
========================================
  Coverage    82.84%   82.84%           
========================================
  Files           47       47           
  Lines         2093     2093           
  Branches       620      620           
========================================
  Hits          1734     1734           
  Misses         359      359           
Flag Coverage Δ
unittests 82.84% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tmigone tmigone merged commit 8e7f89a into horizon Aug 22, 2025
6 checks passed
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.

3 participants