-
Notifications
You must be signed in to change notification settings - Fork 626
[Feat] For prover 4.6.1 #1742
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: develop
Are you sure you want to change the base?
[Feat] For prover 4.6.1 #1742
Changes from all commits
da31b5c
3b81b64
48ef53d
c496100
202c71c
4125a9a
5a55e80
5ff491d
27730ab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -238,6 +238,19 @@ pub unsafe extern "C" fn gen_wrapped_proof( | |
} | ||
} | ||
|
||
/// # Safety | ||
#[no_mangle] | ||
pub unsafe extern "C" fn univ_task_compatibility_fix(task_json: *const c_char) -> *mut c_char { | ||
let task_json_str = c_char_to_str(task_json); | ||
match libzkp::univ_task_compatibility_fix(task_json_str) { | ||
Ok(result) => CString::new(result).unwrap().into_raw(), | ||
Err(e) => { | ||
tracing::error!("univ_task_compability_fix failed, error: {:#}", e); | ||
std::ptr::null_mut() | ||
} | ||
} | ||
} | ||
Comment on lines
+241
to
+252
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. 🛠️ Refactor suggestion 🧩 Analysis chainConst-correctness with C header declaration. Ensure the C header uses 🏁 Script executed: #!/bin/bash
# Verify the C declaration is const-correct
rg -n -C2 -P '\buniv_task_compatibility_fix\s*\(' coordinator | sed -n '1,200p'
rg -n -P '\buniv_task_compatibility_fix\s*\(\s*const\s+char\s*\*' || echo "Header may be missing const for parameter" Length of output: 791 Use coordinator/internal/logic/libzkp/libzkp.h:60 currently has 🤖 Prompt for AI Agents
|
||
|
||
/// # Safety | ||
#[no_mangle] | ||
pub unsafe extern "C" fn release_string(ptr: *mut c_char) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
-- Create a file with INSERT statements for the specific records | ||
\o block_export.sql | ||
\o 00100_import_blocks.sql | ||
\t on | ||
\a | ||
-- Write header comment | ||
SELECT '-- +goose Up'; | ||
SELECT '-- +goose StatementBegin'; | ||
SELECT ''; | ||
|
||
SELECT 'INSERT INTO l2_block (number, hash, parent_hash, header, withdraw_root, | ||
state_root, tx_num, gas_used, block_timestamp, row_consumption, | ||
chunk_hash, transactions | ||
|
@@ -22,6 +27,15 @@ SELECT 'INSERT INTO l2_block (number, hash, parent_hash, header, withdraw_root, | |
FROM l2_block | ||
WHERE number >= 10973700 and number <= 10973730 | ||
ORDER BY number ASC; | ||
|
||
-- Write footer | ||
SELECT ''; | ||
SELECT '-- +goose StatementEnd'; | ||
SELECT '-- +goose Down'; | ||
SELECT '-- +goose StatementBegin'; | ||
SELECT 'DELETE FROM l2_block;'; | ||
SELECT '-- +goose StatementEnd'; | ||
Comment on lines
+31
to
+37
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. Limit the Down migration to rows inserted by this script DELETE FROM l2_block; will wipe the entire table, which is risky even in e2e. Apply this diff to target the same block range used above: -SELECT 'DELETE FROM l2_block;';
+SELECT 'DELETE FROM l2_block WHERE number BETWEEN 10973700 AND 10973730;'; If BEGIN_BLOCK/END_BLOCK are parameterized elsewhere, mirror them here to keep Up/Down symmetrical. 🤖 Prompt for AI Agents
|
||
|
||
\t off | ||
\a | ||
\o |
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.
🛠️ Refactor suggestion
🧩 Analysis chain
FFI wrapper looks good; confirm header const-correctness.
Memory handling is correct (free input, release returned). Confirm
libzkp.h
declaresconst char*
for the parameter.🏁 Script executed:
Length of output: 197
Change header to use const char for input*
libzkp.h currently declares
char* univ_task_compatibility_fix(char* task_json);
— update the parameter toconst char* task_json
(returnchar*
can remain). File: coordinator/internal/logic/libzkp/libzkp.h:60🤖 Prompt for AI Agents