Mint: migration to clean up overly large witnesses (#817)

* add migration to clean up overly large witnesses

* bump to 0.18.1
This commit is contained in:
callebtc
2025-11-04 19:39:16 +01:00
committed by GitHub
parent c8566437f9
commit cf4cbbe882
6 changed files with 96 additions and 4 deletions

View File

@@ -1137,3 +1137,21 @@ async def m028_promises_c_allow_null_add_melt_quote(db: Database):
# recreate the balance views
await create_balance_views(db, conn)
async def m029_remove_overlong_witness_values(db: Database):
"""
Delete any witness values longer than 1024 characters in proofs tables.
"""
async with db.connect() as conn:
# Clean proofs_used
await conn.execute(
f"UPDATE {db.table_with_schema('proofs_used')} SET witness = NULL "
"WHERE witness IS NOT NULL AND LENGTH(witness) > 1024"
)
# Clean proofs_pending (column exists in newer schemas)
await conn.execute(
f"UPDATE {db.table_with_schema('proofs_pending')} SET witness = NULL "
"WHERE witness IS NOT NULL AND LENGTH(witness) > 1024"
)