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

Use slot instead of inserted_at for counting delivered payloads #28

Closed
metachris opened this issue Feb 22, 2024 · 0 comments · Fixed by #33
Closed

Use slot instead of inserted_at for counting delivered payloads #28

metachris opened this issue Feb 22, 2024 · 0 comments · Fixed by #33

Comments

@metachris
Copy link
Contributor

Currently, relayscan shows delivered payload for relays by using inserted_at: https://github.com/flashbots/relayscan/blob/main/database/database.go#L83-L88

This is less accurate than using slot, in particular since there may be downtimes on updates / querying the relay APIs, or when a new relay is added and all past payloads are attributed to insert time.

The more accurate way would be to calculate first and last slot of a given timerange. For inspiration, this is a conversion script from slot to timestamp:

$ type slot-date
slot-date is a function
slot-date ()
{
    ts=$(( ($1 * 12) + 1606824023 ));
    echo "slot start timestamp: $ts";
    date -u -d @"$ts"
}
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 a pull request may close this issue.

1 participant