-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Current State
The date-to-blockheight converter is working but has room for improvement:
-
No popup datepicker - Currently using native
<input type="datetime-local">which varies by browser. A proper datepicker widget would provide a more consistent UX. -
Block height accuracy - Current calculation uses a fixed 12.12 second average block time:
var blocksDiff = Math.round((refTimestamp - targetTimestamp) / 12.12); return refBlock - blocksDiff;
This could be improved by:
- Fetching actual block timestamps from an API for more precise calculation
- Using a reference block closer to the target date
- Accounting for block time variations over different periods
Location
extensions/BlueRailroadIntegration/resources/ext.bluerailroad.datepicker.js
Possible Improvements
- Use a JS datepicker library (flatpickr, pikaday, etc.) for consistent cross-browser UI
- Query Etherscan/Alchemy API for actual block-to-timestamp mapping
- Add visual feedback showing confidence level of the estimate
- Consider using binary search between known block timestamps for better accuracy
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels