Skip to content

Commit

Permalink
Merge pull request #58 from datachainlab/update-lcp
Browse files Browse the repository at this point in the history
Update lcp and compiler versions

Signed-off-by: Jun Kimura <[email protected]>
  • Loading branch information
bluele authored Sep 12, 2024
2 parents 7d2b271 + c652674 commit 3a92c14
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 358 deletions.
379 changes: 34 additions & 345 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions light-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
light-client = { git = "https://github.com/datachainlab/lcp", rev = "v0.2.9", default-features = false, features=["ibc"] }
light-client = { git = "https://github.com/datachainlab/lcp", rev = "v0.2.10", default-features = false }

rlp = { version = "0.5.2", default-features = false }
prost = { version = "0.11", default-features = false }
Expand All @@ -28,8 +28,8 @@ milagro_bls = { git = "https://github.com/datachainlab/milagro_bls", rev = "bc2b
hex-literal = "0.4.1"

[dev-dependencies]
store = { git = "https://github.com/datachainlab/lcp.git", rev = "v0.2.9", default-features = false }
time = { version = "0.3", default-features = false, features = ["macros", "parsing"] }
store = { git = "https://github.com/datachainlab/lcp.git", rev = "v0.2.10", default-features = false }
time = { version = "0.3", default-features = false }
rstest = "0.18"

[features]
Expand Down
2 changes: 0 additions & 2 deletions light-client/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ pub enum Error {
UnexpectedDifficulty(BlockNumber, u64),
UnexpectedNonce(BlockNumber),
UnexpectedRecoveryId(BlockNumber),
UnexpectedEncodedPoint(BlockNumber),
UnexpectedAddress(BlockNumber),
UnexpectedCoinbase(BlockNumber),
MissingSignerInValidator(BlockNumber, Address),
Expand Down Expand Up @@ -178,7 +177,6 @@ impl core::fmt::Display for Error {
Error::UnexpectedDifficulty(e1, e2) => write!(f, "UnexpectedDifficulty: {} {}", e1, e2),
Error::UnexpectedNonce(e) => write!(f, "UnexpectedNonce: {}", e),
Error::UnexpectedRecoveryId(e) => write!(f, "UnexpectedRecoveryId: {}", e),
Error::UnexpectedEncodedPoint(e) => write!(f, "UnexpectedEncodedPoint: {}", e),
Error::UnexpectedAddress(e) => write!(f, "UnexpectedAddress: {}", e),
Error::UnexpectedCoinbase(e) => write!(f, "UnexpectedCoinbase: {}", e),
Error::MissingSignerInValidator(e1, e2) => {
Expand Down
7 changes: 2 additions & 5 deletions light-client/src/header/eth_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,7 @@ impl ETHHeader {
let signer = VerifyingKey::recover_from_prehash(&seal_hash, &signature, rid)
.map_err(|e| Error::UnexpectedSignature(self.number, e))?;
let point = signer.as_affine().to_encoded_point(false);
let pubkey: Vec<u8> = point
.to_bytes()
.try_into()
.map_err(|_e| Error::UnexpectedEncodedPoint(self.number))?;
let pubkey: Vec<u8> = point.to_bytes().into();
let address: Address = keccak_256(&pubkey[1..])[12..]
.try_into()
.map_err(|_e| Error::UnexpectedAddress(self.number))?;
Expand Down Expand Up @@ -670,7 +667,7 @@ pub(crate) mod test {
};
}

for mut block in blocks.iter_mut() {
for block in blocks.iter_mut() {
block.coinbase = vec![];
let result = block.verify_seal(&prev_epoch, &hp.network());
match result.unwrap_err() {
Expand Down
2 changes: 1 addition & 1 deletion light-client/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![no_std]

#![allow(clippy::result_large_err)]
#[cfg_attr(not(test), macro_use)]
extern crate alloc;
#[cfg(test)]
Expand Down
4 changes: 3 additions & 1 deletion proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ all-features = true
[dependencies]
prost = { version = "0.11", default-features = false }
serde = { version = "1.0", default-features = false }
schemars = { version = "0.8", optional = true }
ibc-proto = { version = "0.26.0", default-features = false }

[features]
default = ["std"]
std = []
std = []
json-schema = ["schemars"]
1 change: 1 addition & 0 deletions proto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#![cfg_attr(not(feature = "std"), no_std)]
#![deny(warnings, trivial_casts, trivial_numeric_casts, unused_import_braces)]
#![allow(clippy::large_enum_variant)]
#![allow(clippy::too_long_first_doc_paragraph)]
#![allow(rustdoc::bare_urls)]
#![forbid(unsafe_code)]

Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2022-10-22
nightly-2024-09-05

0 comments on commit 3a92c14

Please sign in to comment.