You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* debug snap metadata issues
* fix: add has_sector_key column to replace broken orig!=cur snap detection
The assumption that orig_sealed_cid != cur_sealed_cid indicates a snap-upgraded
sector breaks when deal data is all zeros: the encode formula out[i] = key[i] +
data[i]*rho(i) produces key[i] when data[i]=0, leaving CommR unchanged and
SealedCID == SectorKeyCID on chain.
Add has_sector_key BOOLEAN to sectors_meta that mirrors chain SectorKeyCID state:
- Set TRUE in transferUpdatedSectorData during snap submit
- Reconciled from chain by SectorMetadata task (batched, 100 sectors/txn)
- Seeded from orig!=cur in migration for common case; zero-data edge cases
fixed by next metadata task run
Replace all snap detection consumers:
- is_cc triggers: use NOT has_sector_key instead of CID comparison
- GC mark: query has_sector_key=TRUE instead of orig!=cur
- Unseal decode: use HasSectorKey instead of commK!=commR (critical: was
calling DecodeSDR instead of DecodeSnap for zero-data snaps)
- Web UI: derive IsSnap from has_sector_key, fix mismatch detection
- Guided setup: set has_sector_key from lotus UpdateSealed presence
Also add encode-time guard rejecting snaps where output CommR equals input
CommR, preventing future zero-data snaps from entering the pipeline.
* fix: downgrade identical CommR snap check from error to warning
Zero-data snaps are valid on chain; has_sector_key handles the
detection correctly so there is no reason to reject the encode.
* fix: add downgrade file for has_sector_key migration
Reverts triggers to the 20260315 version (orig_sealed_cid check).
Keeps the has_sector_key column to avoid data loss.
returnfalse, xerrors.Errorf("Proof mismatch between on chain %d and local database %d for sector %d of miner %d", onChainInfo.SealProof, regProof, update.SectorNumber, update.SpID)
240
240
}
241
241
242
+
// Check that the sector is a CC sector (SectorKeyCID must be nil for CC sectors).
243
+
// If SectorKeyCID is set, the sector was already snapped and cannot be updated again.
244
+
ifonChainInfo.SectorKeyCID!=nil {
245
+
log.Errorw("sector is not CC on-chain (SectorKeyCID is set), skipping", "sp", update.SpID, "sector", update.SectorNumber, "sector_key_cid", onChainInfo.SectorKeyCID)
246
+
247
+
_, err:=s.db.Exec(ctx, `UPDATE sectors_snap_pipeline SET
0 commit comments