Skip to content

Conversation

@jyeshe
Copy link

@jyeshe jyeshe commented Aug 14, 2025

What

This is a more strict implementation of #427 that "Reject reads with invalid/missing prefixes".

Why

As such it satisfies all FOR-137 expected behaviour:

  • All data values should be prefixed with data: when written
  • All reads should validate the first 5 characters of the raw value (except for group)
  • Parse prefix from binary string: data: or link:
  • Reject reads with invalid/missing prefixes

Additional Notes

This PR is ready for review however it's on Draft once it can only be merged when a migration strategy is defined in regards to the existings caches without the prefix for data.
There will be no migration and the sync is part of the scope of a following task.

@jyeshe jyeshe requested a review from twilson63 August 14, 2025 11:02
@jyeshe
Copy link
Author

jyeshe commented Aug 14, 2025

@twilson63 by enforcing the read to also to match a prefix, which demands existing values to be rewritten, you will notice it allows a lot of simplification on the code making it more readable.

@jyeshe jyeshe force-pushed the for137/invalidate-data-wo-prefix branch 2 times, most recently from da5e961 to 2c1c777 Compare August 14, 2025 11:08
@jyeshe
Copy link
Author

jyeshe commented Aug 14, 2025

@twilson63 FYI two details were discussed in the daily:

  1. We should not provide a migrate function (users can easily rebuild the cache by themselves)
  2. The sync was considered as part of the scope of a following task.

Should I work on the 2nd or do we have other priorities? cc @samcamwilliams
EDIT: The issue for the sync is this one https://linear.app/forward-research/issue/FOR-139/feat-add-sync-function-for-hb-store

@jyeshe jyeshe marked this pull request as ready for review August 14, 2025 15:13
@jyeshe
Copy link
Author

jyeshe commented Aug 14, 2025

Only a flaky failed.

      dev_router: dynamic_routing_by_performance...*failed*
in function hb_cache:report_ensure_loaded_not_found/3 (/Volumes/T7Shield/HyperBEAM_shield/src/hb_cache.erl, line 132)

Failed: 1. Skipped: 0. Passed: 1204.

@jyeshe jyeshe changed the title Enforce LMDB to read and write always with a prefix FOR-137: Enforce LMDB to read and write always with a prefix Aug 15, 2025
@jyeshe jyeshe changed the title FOR-137: Enforce LMDB to read and write always with a prefix impr: Enforce LMDB to read and write always with a prefix (FOR-137) Aug 19, 2025
@jyeshe jyeshe force-pushed the for137/invalidate-data-wo-prefix branch 2 times, most recently from 2f16c80 to 3e50b92 Compare September 10, 2025 16:07
@jyeshe jyeshe force-pushed the for137/invalidate-data-wo-prefix branch from 3e50b92 to 7203562 Compare September 11, 2025 13:32
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