Skip to content

Use slot instead of inserted_at for counting delivered payloads #28

Description

@metachris

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"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions