-
Notifications
You must be signed in to change notification settings - Fork 37
⚡ Bolt: Optimized Blockchain Verification to O(1) #449
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
base: main
Are you sure you want to change the base?
Changes from all commits
81d582b
838a1a2
64a9720
c1f082a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -175,8 +175,13 @@ async def create_issue( | |||||||
| ) | ||||||||
| prev_hash = prev_issue[0] if prev_issue and prev_issue[0] else "" | ||||||||
|
|
||||||||
| # Simple but effective SHA-256 chaining | ||||||||
| hash_content = f"{description}|{category}|{prev_hash}" | ||||||||
| # Blockchain Feature: Geographically sealed chaining | ||||||||
|
||||||||
| # Blockchain Feature: Geographically sealed chaining | |
| # Blockchain Feature: Geographically sealed chaining |
Copilot
AI
Feb 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment "for consistent hashing as per memory" is unclear/irrelevant in-source (it reads like an internal note rather than a spec). Consider replacing it with a concrete rationale (e.g., "to avoid float serialization differences") or a link/reference to a design doc/test that defines the 7-decimal formatting contract.
| # Format lat/lon to 7 decimal places for consistent hashing as per memory | |
| # Format lat/lon to 7 decimal places to ensure deterministic hashing across | |
| # environments (avoids float serialization/rounding differences altering the chain). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Using "0.0000000" as the placeholder for missing latitude/longitude makes the integrity hash collide with valid coordinates at (0.0, 0.0). That means a report can flip between “no coordinates” and a real (0,0) location without changing the hash. Use a distinct sentinel (e.g., "null") for missing coordinates in both hash generation and verification to avoid collisions.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At backend/routers/issues.py, line 180:
<comment>Using "0.0000000" as the placeholder for missing latitude/longitude makes the integrity hash collide with valid coordinates at (0.0, 0.0). That means a report can flip between “no coordinates” and a real (0,0) location without changing the hash. Use a distinct sentinel (e.g., "null") for missing coordinates in both hash generation and verification to avoid collisions.</comment>
<file context>
@@ -175,8 +175,13 @@ async def create_issue(
- hash_content = f"{description}|{category}|{prev_hash}"
+# Blockchain Feature: Geographically sealed chaining
+ # Format lat/lon to 7 decimal places for consistent hashing as per memory
+ lat_str = f"{latitude:.7f}" if latitude is not None else "0.0000000"
+ lon_str = f"{longitude:.7f}" if longitude is not None else "0.0000000"
+
</file context>
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P1: Defaulting to a wildcard CORS regex in production when FRONTEND_URL is missing opens the API to any Netlify subdomain. This weakens CORS protection compared to the previous fail-fast behavior and can allow unintended origins to access authenticated endpoints.
Prompt for AI agents