Freeze corrected full-volume ordering diagnostic and one-time custody contract
This commit is contained in:
1 parent
6d907acc7c
commit
d2adb6bcce
14 files changed
+2599
No files matched your search
@@ -0,0 +1,21 @@
|
||||
"""Independent bounded batch input verification; never touches S3-A sources."""
|
||||
from pathlib import Path
|
||||
from freeze_g1_components import sha
|
||||
from s2_custody_common import read_json, checked
|
||||
|
||||
|
||||
def contract(root):
|
||||
root = Path(root)
|
||||
c = read_json(root/'contract.json')
|
||||
for p,h in {**c['code_sha256'],**c['source_sha256']}.items():
|
||||
checked(p,h)
|
||||
frozen = read_json(root/'code-freeze.json')
|
||||
if not frozen.get('git_commit') or frozen['contract_sha256'] != sha(root/'contract.json'):
|
||||
raise ValueError('Naive-ordering contract/code must be fixed before any execution')
|
||||
if c['latest_ruling'] != '1794733619.697459' or c['limits']['worker_cpu_seconds'] != 36000:
|
||||
raise ValueError('Wrong custody authorization or budget')
|
||||
return c
|
||||
|
||||
|
||||
def rows(c):
|
||||
return sorted((r for r in read_json(checked(c['roster'],c['roster_sha256']))['parts'] if r['included']),key=lambda r:r['case'])
|
||||
Reference in new issue
Block a user