Skip to content

Commit

Permalink
Merge pull request #31 from datachainlab/audit-202411
Browse files Browse the repository at this point in the history
Audit 202411

Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
  • Loading branch information
bluele authored Dec 24, 2024
2 parents ff8fbed + f895ffd commit 90f11c1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ displaydoc = { version = "0.2", default-features = false }
tiny-keccak = { version = "2.0.2", default-features = false }

light-client = { git = "https://github.com/datachainlab/lcp", rev = "v0.2.12", default-features = false, features = ["ibc"] }
ethereum-ibc = { git = "https://github.com/datachainlab/ethereum-ibc-rs", rev = "v0.0.19", default-features = false }
ethereum-ibc = { git = "https://github.com/datachainlab/ethereum-ibc-rs", rev = "v0.1.0", default-features = false }

[dev-dependencies]
hex-literal = "0.4.1"
lcp-types = { git = "https://github.com/datachainlab/lcp", rev = "v0.2.12", default-features = false, features = ["std"] }
store = { git = "https://github.com/datachainlab/lcp", rev = "v0.2.12", default-features = false }
ethereum-consensus = { git = "https://github.com/datachainlab/ethereum-light-client-rs", rev = "v0.1.7", default-features = false, features = ["prover"] }
ethereum-light-client-verifier = { git = "https://github.com/datachainlab/ethereum-light-client-rs", rev = "v0.1.7", default-features = false, features = ["test-utils"] }
ethereum-consensus = { git = "https://github.com/datachainlab/ethereum-light-client-rs", rev = "v0.2.0", default-features = false, features = ["prover"] }
ethereum-light-client-verifier = { git = "https://github.com/datachainlab/ethereum-light-client-rs", rev = "v0.2.0", default-features = false, features = ["test-utils"] }
4 changes: 2 additions & 2 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ mod tests {
config::minimal::get_config(),
keccak256("genesis_validators_root"),
U64(1578009600),
Fraction::new(2, 3),
Fraction::new(2, 3).unwrap(),
SystemTime::now()
.duration_since(SystemTime::UNIX_EPOCH)
.unwrap()
Expand Down Expand Up @@ -557,7 +557,7 @@ mod tests {
ibc_commitments_slot: H256(hex!(
"1ee222554989dda120e26ecacf756fe1235cd8d726706b57517715dde4f0c900"
)),
trust_level: Fraction::new(2, 3),
trust_level: Fraction::new(2, 3).unwrap(),
trusting_period: Duration::from_secs(60 * 60 * 27),
max_clock_drift: Duration::from_secs(60),
latest_execution_block_number: 1.into(),
Expand Down
3 changes: 2 additions & 1 deletion src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ use light_client::commitments::{gen_state_id_from_any, StateID};
use light_client::types::proto::google::protobuf::Any as IBCAny;

// canonicalize_client_state canonicalizes some fields of specified client state
// target fields: latest_execution_block_number
// target fields: latest_execution_block_number, frozen_height
pub fn canonicalize_client_state<const SYNC_COMMITTEE_SIZE: usize>(
client_state: ClientState<SYNC_COMMITTEE_SIZE>,
) -> ClientState<SYNC_COMMITTEE_SIZE> {
let mut client_state = client_state;
client_state.latest_execution_block_number = 0u64.into();
client_state.frozen_height = None;
client_state
}

Expand Down

0 comments on commit 90f11c1

Please # to comment.