Skip to content
This repository has been archived by the owner on Sep 23, 2023. It is now read-only.

Added struct to hold bor sprints in numeric order #1038

Merged
merged 1 commit into from
Jul 14, 2023

Conversation

mh0lt
Copy link
Contributor

@mh0lt mh0lt commented Jul 1, 2023

This checking replaces the config processing for bor sprints which has the following issues:

  1. It uses string ordering for blocks which is lexical so does not handle decimal scale when sorting numbers
  2. It parses the config map every calculation - which is expensive relative to just checking the index order

This is likely not an issue for the existing main net as the map only has 2 entries and their sort order is coincidentally the same for both lexical and numeric ordering. Performance is likely also a non issue compared to the other processing during execution flow.

These changes are intended to support tx indexing where in the snapshotting process the calc will get called at least twice for each bor block during 1000's of iterations.

@AlexeyAkhunov AlexeyAkhunov marked this pull request as ready for review July 14, 2023 10:07
@AlexeyAkhunov AlexeyAkhunov added this pull request to the merge queue Jul 14, 2023
Merged via the queue into main with commit 886a982 Jul 14, 2023
@AlexeyAkhunov AlexeyAkhunov deleted the fix_bor_sprint_calc branch July 14, 2023 10:09
AskAlexSharov pushed a commit that referenced this pull request Sep 6, 2023
This checking replaces the config processing for bor sprints which has
the following issues:

1. It uses string ordering for blocks which is lexical so does not
handle decimal scale when sorting numbers
2. It parses the config map every calculation - which is expensive
relative to just checking the index order

This is likely not an issue for the existing main net as the map only
has 2 entries and their sort order is coincidentally the same for both
lexical and numeric ordering. Performance is likely also a non issue
compared to the other processing during execution flow.

These changes are intended to support tx indexing where in the
snapshotting process the calc will get called at least twice for each
bor block during 1000's of iterations.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants