Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 276
fix: persist snapshot once for avoiding badger vlog#3153
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
6729abdd1e578a3fbdfae28ffadf0eefee8662c81eFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -2,10 +2,10 @@ module github.com/evstack/ev-node/apps/evm | ||
| go 1.25.6 | ||
| //replace ( | ||
| // github.com/evstack/ev-node => ../../ | ||
| // github.com/evstack/ev-node/execution/evm => ../../execution/evm | ||
| //) | ||
| replace ( | ||
| github.com/evstack/ev-node => ../../ | ||
| github.com/evstack/ev-node/execution/evm => ../../execution/evm | ||
| ) | ||
Comment on lines
+5
to
+8
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bashset -euo pipefail
python - <<'PY'from pathlib import Pathmod = Path("apps/evm/go.mod")module_dir = mod.parent.resolve()for raw in mod.read_text().splitlines(): line = raw.strip() if "=>" not in line or line.startswith("//"): continue left, right = [part.strip() for part in line.split("=>", 1)] if left.startswith("replace "): target = right.split()[0] elif left.startswith("github.com/"): target = right.split()[0] else: continue if target.startswith("."): resolved = (module_dir / target).resolve() escapes = module_dir not in (resolved, *resolved.parents) print(f"{mod}: {target} -> {resolved}") print(f"escapes module dir: {escapes}")PYRepository: evstack/ev-node Length of output: 227 🏁 Script executed: # Check if go.work exists in repo root
ls -la go.work 2>/dev/null ||echo"go.work not found"# Check the actual module path in apps/evm/go.mod
head -5 apps/evm/go.mod
# Check Go version requirement
head -3 go.modRepository: evstack/ev-node Length of output: 186 🏁 Script executed: # Search for any references to go.work or workspace setup
rg "go.work" --type md --type txt --type sh .# Check if there are any build/CI configurations that might show intended usage
fd -t f -e yml -e yaml -e Makefile | head -20
# Look for any documentation about building apps/evm standalone
rg "apps/evm" --type md . -A 3Repository: evstack/ev-node Length of output: 1538 These local The Move these replacements to a 🤖 Prompt for AI Agents | ||
| require ( | ||
| github.com/ethereum/go-ethereum v1.17.1 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -2,7 +2,7 @@ module github.com/evstack/ev-node/apps/testapp | ||
| go 1.25.6 | ||
| //replace github.com/evstack/ev-node => ../../. | ||
| replace github.com/evstack/ev-node => ../../. | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bashset -euo pipefail
python - <<'PY'from pathlib import Pathmod = Path("apps/testapp/go.mod")module_dir = mod.parent.resolve()for raw in mod.read_text().splitlines(): line = raw.strip() if "=>" not in line or line.startswith("//"): continue left, right = [part.strip() for part in line.split("=>", 1)] if left.startswith("replace "): target = right.split()[0] elif left.startswith("github.com/"): target = right.split()[0] else: continue if target.startswith("."): resolved = (module_dir / target).resolve() escapes = module_dir not in (resolved, *resolved.parents) print(f"{mod}: {target} -> {resolved}") print(f"escapes module dir: {escapes}")PYRepository: evstack/ev-node Length of output: 134 Do not commit a relative
🤖 Prompt for AI Agents | ||
| require ( | ||
| github.com/evstack/ev-node v1.0.0-rc.5 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -141,7 +141,7 @@ func (c *Cache[T]) getDAIncludedByHeight(blockHeight uint64) (uint64, bool) { | ||
| return c.getDAIncluded(hash) | ||
| } | ||
| // setDAIncluded records DA inclusion and persists the snapshot. | ||
| // setDAIncluded records DA inclusion in memory. | ||
| // If a previous entry already exists at blockHeight (e.g. a placeholder from | ||
| // RestoreFromStore), it is evicted from daIncluded to avoid orphan leaks. | ||
| func (c *Cache[T]) setDAIncluded(hash string, daHeight uint64, blockHeight uint64) { | ||
| @@ -151,14 +151,11 @@ func (c *Cache[T]) setDAIncluded(hash string, daHeight uint64, blockHeight uint6 | ||
| c.daIncluded.Add(hash, daHeight) | ||
| c.hashByHeight.Add(blockHeight, hash) | ||
| c.setMaxDAHeight(daHeight) | ||
| _ = c.persistSnapshot(context.Background()) | ||
| } | ||
| // removeDAIncluded removes the DA-included status of the hash from the cache | ||
| // and rewrites the window snapshot. | ||
| // removeDAIncluded removes the DA-included status of the hash from the cache. | ||
| func (c *Cache[T]) removeDAIncluded(hash string) { | ||
| c.daIncluded.Remove(hash) | ||
| _ = c.persistSnapshot(context.Background()) | ||
| } | ||
| // daHeight returns the maximum DA height from all DA-included items. | ||
| @@ -185,7 +182,7 @@ func (c *Cache[T]) removeSeen(hash string) { | ||
| } | ||
| // deleteAllForHeight removes all items and their associated data from the | ||
| // cache at the given height and rewrites the window snapshot. | ||
| // cache at the given height. | ||
| func (c *Cache[T]) deleteAllForHeight(height uint64) { | ||
| c.itemsByHeight.Remove(height) | ||
| @@ -200,13 +197,10 @@ func (c *Cache[T]) deleteAllForHeight(height uint64) { | ||
| c.hashes.Remove(hash) | ||
| c.daIncluded.Remove(hash) | ||
| } | ||
| _ = c.persistSnapshot(context.Background()) | ||
| } | ||
| // persistSnapshot writes all current in-flight [blockHeight, daHeight] pairs | ||
| // to the store under a single key. Called on every mutation; payload is tiny | ||
| // (typically <10 entries × 16 bytes). | ||
| // persistSnapshot writes all current in-flight [blockHeight, daHeight] pairs to the store under a single key. | ||
| // Only called explicitly via SaveToStore. NEVER CALL IT ON HOT-PATH TO AVOID BAGER WRITE AMPLIFICATION. | ||
Comment on lines
+202
to
+203
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't leave the new shutdown flush as best-effort. These lines make 🤖 Prompt for AI Agents | ||
| func (c *Cache[T]) persistSnapshot(ctx context.Context) error { | ||
| if c.store == nil || c.storeKeyPrefix == "" { | ||
| return nil | ||
Uh oh!
There was an error while loading. Please reload this page.
Check warning
Code scanning / CodeQL
Unpinned tag for a non-immutable Action in workflow or composite action Medium