Skip to content
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

feat(libzkp):unbounded depth serde json #920

Merged
merged 28 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d2014b8
feat: add transactions len metrics of block processer
georgehao Mar 3, 2024
36d5590
Merge branch 'develop' of github.com:scroll-tech/go-ethereum into dev…
georgehao Mar 4, 2024
00a75fa
Merge branch 'develop' of github.com:scroll-tech/go-ethereum into dev…
georgehao Mar 7, 2024
77b8381
Merge branch 'develop' of github.com:scroll-tech/go-ethereum into dev…
georgehao Mar 14, 2024
6be368b
Merge branch 'develop' of github.com:scroll-tech/go-ethereum into dev…
georgehao Mar 18, 2024
d4d1e9a
Merge branch 'develop' of github.com:scroll-tech/go-ethereum into dev…
georgehao Mar 24, 2024
c9b8b4a
Merge branch 'develop' of github.com:scroll-tech/go-ethereum into dev…
georgehao Mar 27, 2024
f01e6c3
Merge branch 'develop' of github.com:scroll-tech/go-ethereum into dev…
georgehao Mar 30, 2024
728ee6c
Merge branch 'develop' of github.com:scroll-tech/go-ethereum into dev…
georgehao Apr 7, 2024
5a34f06
Merge branch 'develop' of github.com:scroll-tech/go-ethereum into dev…
georgehao Apr 8, 2024
4e05762
Merge branch 'develop' of github.com:scroll-tech/go-ethereum into dev…
georgehao Apr 8, 2024
3e2bccc
Merge branch 'develop' of github.com:scroll-tech/go-ethereum into dev…
georgehao Apr 16, 2024
e17a131
Merge branch 'develop' of github.com:scroll-tech/go-ethereum into dev…
georgehao Apr 16, 2024
109b703
Merge branch 'develop' of github.com:scroll-tech/go-ethereum into dev…
georgehao Apr 18, 2024
8d0a496
Merge branch 'develop' of github.com:scroll-tech/go-ethereum into dev…
georgehao May 6, 2024
a73bbdb
Merge branch 'develop' of github.com:scroll-tech/go-ethereum into dev…
georgehao May 20, 2024
6753d83
Merge branch 'develop' of github.com:scroll-tech/go-ethereum into dev…
georgehao May 27, 2024
5c6b619
Merge branch 'develop' of github.com:scroll-tech/go-ethereum into dev…
georgehao May 29, 2024
d33e5d6
Merge branch 'develop' of github.com:scroll-tech/go-ethereum into dev…
georgehao May 30, 2024
a7c195b
Merge branch 'develop' of github.com:scroll-tech/go-ethereum into dev…
georgehao Jun 12, 2024
349b625
Merge branch 'develop' of github.com:scroll-tech/go-ethereum into dev…
georgehao Jun 12, 2024
3046c6f
Merge branch 'develop' of github.com:scroll-tech/go-ethereum into dev…
georgehao Jun 17, 2024
a763626
Merge branch 'develop' of github.com:scroll-tech/go-ethereum into dev…
georgehao Jul 10, 2024
db4c36a
fix
georgehao Jul 24, 2024
a5d9882
Merge branch 'develop' into feat/unbounded_depth_serde_json
georgehao Jul 24, 2024
cca036d
format
georgehao Jul 24, 2024
13a1a8f
chore: auto version bump [bot]
georgehao Jul 24, 2024
1dffafb
remove unusd code
georgehao Jul 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion params/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
const (
VersionMajor = 5 // Major version component of the current release
VersionMinor = 5 // Minor version component of the current release
VersionPatch = 16 // Patch version component of the current release
VersionPatch = 17 // Patch version component of the current release
VersionMeta = "mainnet" // Version metadata to append to the version string
)

Expand Down
2 changes: 1 addition & 1 deletion rollup/circuitcapacitychecker/libzkp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ log = "0.4"
once_cell = "1.19"
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0.66"
serde_json = { version = "1.0.66", features = ["unbounded_depth"] }

[profile.test]
opt-level = 3
Expand Down
23 changes: 14 additions & 9 deletions rollup/circuitcapacitychecker/libzkp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ pub mod checker {
use std::panic;
use std::ptr::null;
use std::ffi::CStr;
use serde::Deserialize as Deserializea;
use serde_json::Deserializer;

#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct CommonResult {
Expand Down Expand Up @@ -48,7 +50,10 @@ pub mod checker {
#[no_mangle]
pub unsafe extern "C" fn parse_json_to_rust_trace(trace_json_ptr: *const c_char) -> *mut BlockTrace {
let trace_json_cstr = unsafe { CStr::from_ptr(trace_json_ptr) };
let trace = serde_json::from_slice::<BlockTrace>(trace_json_cstr.to_bytes());
let trace_json_bytes = trace_json_cstr.to_bytes();
let mut deserializer = Deserializer::from_slice(trace_json_bytes);
deserializer.disable_recursion_limit();
let trace = BlockTrace::deserialize(&mut deserializer);
match trace {
Err(e) => {
log::warn!(
Expand Down Expand Up @@ -233,10 +238,10 @@ pub mod checker {
))?
.get_tx_num() as u64)
})
.map_or_else(
|e| bail!("circuit capacity checker (id: {id}) error in get_tx_num: {e:?}"),
|result| result,
)
.map_or_else(
|e| bail!("circuit capacity checker (id: {id}) error in get_tx_num: {e:?}"),
|result| result,
)
}

/// # Safety
Expand Down Expand Up @@ -267,10 +272,10 @@ pub mod checker {
.set_light_mode(light_mode);
Ok(())
})
.map_or_else(
|e| bail!("circuit capacity checker (id: {id}) error in set_light_mode: {e:?}"),
|result| result,
)
.map_or_else(
|e| bail!("circuit capacity checker (id: {id}) error in set_light_mode: {e:?}"),
|result| result,
)
}
}

Expand Down
Loading