Skip to content

Commit

Permalink
refactor: remove the limitation of set ckb related info (#1517)
Browse files Browse the repository at this point in the history
* refactor: remove  limitation of set ckb related info

* style: add some annotation
  • Loading branch information
Eason Gao authored Oct 30, 2023
1 parent f9974e6 commit 0576581
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 2 additions & 0 deletions core/consensus/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ pub fn time_now() -> u64 {
/// `keccak256` hash calculation at the end of each height. The reason why not
/// use address directly is that the `PeerId` is binding with public key not
/// address.
/// The `common_ref` do not affect the signature verification, it is a
/// placeholder.
pub struct OverlordCrypto {
private_key: BlsPrivateKey,
addr_pubkey: RwLock<HashMap<Bytes, BlsPublicKey>>,
Expand Down
4 changes: 0 additions & 4 deletions core/executor/src/system_contract/metadata/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ impl<Adapter: ExecutorAdapter + ApplyBackend> SystemContract<Adapter>
);
}
metadata_abi::MetadataContractCalls::SetCkbRelatedInfo(c) => {
if !adapter.block_number().is_zero() {
return revert_resp(gas_limit);
}

exec_try!(
store.set_ckb_related_info(&c.info.into()),
gas_limit,
Expand Down
1 change: 1 addition & 0 deletions core/run/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ fn init_crypto(
bls_pub_keys.insert(address, pub_key);
}

// The `common_ref` is a placeholder, use empty string.
let crypto = OverlordCrypto::new(bls_priv_key, bls_pub_keys, String::new());
Ok(Arc::new(crypto))
}
Expand Down

0 comments on commit 0576581

Please sign in to comment.