Skip to content
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

Add signature array processing #9

Merged
merged 1 commit into from
Apr 10, 2024
Merged

Conversation

Marketen
Copy link
Contributor

@Marketen Marketen commented Apr 9, 2024

Adds support for /newSignature endpoint to accept an array of signatures like:

[
  {
    "payload": "eyJwbGF0Zm9ybSI6ICJkYXBwbm9kZSIsICJ0aW1lc3RhbXAiOiAiMTg1OTIxODc3IiwgInB1YmtleSI6ICIweGI0OGM0OTVjMTkwODJkODkyZjM4MjI3YmNlZDg5ZjcxOTlmNGU5YjY0MmJmOTRjN2YyZjFjY2YyOWMwZTZhNmY1NGQ2NTMwMDI1MTNhYTdjZGI1NmM4ODM2ODc5N2VjIn0=",
    "signature": "0xa8b00e7746a523346c5165dfa80ffafe52317c6fe6cdcfabd41886f9c8209b829266c5000597142b58dddbcc9c23cfd81315180acf18bb000db50d08293bc539e06a7c751d3d9dec89fb441b3ba6aefdeeff9cfed72fb41171173f22e2993e74",
    "network": "stader1",
    "label": "example_label1"
  },
  {
    "payload": "eyJwbGF0Zm9ybSI6ICJkYXBwbm9kZSIsICJ0aW1lc3RhbXAiOiAiMTg1OTIxODc3IiwgInB1YmtleSI6ICIweGI0OGM0OTVjMTkwODJkODkyZjM4MjI3YmNlZDg5ZjcxOTlmNGU5YjY0MmJmOTRjN2YyZjFjY2YyOWMwZTZhNmY1NGQ2NTMwMDI1MTNhYTdjZGI1NmM4ODM2ODc5N2VjIn0=",
    "signature": "0xa8b00e7746a523346c5165dfa80ffafe52317c6fe6cdcfabd41886f9c8209b829266c5000597142b58dddbcc9c23cfd81315180acf18bb000db50d08293bc539e06a7c751d3d9dec89fb441b3ba6aefdeeff9cfed72fb41171173f22e2993e74",
    "network": "stader2",
    "label": "example_label2"
  },
  {
    "payload": "eyJwbGF0Zm9ybSI6ICJkYXBwbm9kZSIsICJ0aW1lc3RhbXAiOiAiMTg1OTIxODc3IiwgInB1YmtleSI6ICIweGI0OGM0OTVjMTkwODJkODkyZjM4MjI3YmNlZDg5ZjcxOTlmNGU5YjY0MmJmOTRjN2YyZjFjY2YyOWMwZTZhNmY1NGQ2NTMwMDI1MTNhYTdjZGI1NmM4ODM2ODc5N2VjIn0=",
    "signature": "0xa8b00e7746a523346c5165dfa80ffafe52317c6fe6cdcfabd41886f9c8209b829266c5000597142b58dddbcc9c23cfd81315180acf18bb000db50d08293bc539e06a7c751d3d9dec89fb441b3ba6aefdeeff9cfed72fb41171173f22e2993e74",
    "network": "stader3",
    "label": "example_label3"
  }
]

Processing is done as follows:

  1. Request data structure validation --> check that all elements of the slice have the correct fields and values
  2. Decode payloads --> ensure decoded BASE64 payload has expected "platform", "timestamp" & "pubkey" fields.
  3. Verify onchain validators: Call consensus client with request's valid pubkeys to identify which are from real validators
  4. Verify signatures: Verify signatures from real validator pubkeys
  5. Add to mongodb: Add valid signed messages to mongodb

@Marketen Marketen self-assigned this Apr 9, 2024
@pablomendezroyo pablomendezroyo merged commit 07508b5 into main Apr 10, 2024
1 check 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.

2 participants