Skip to content

Commit

Permalink
Finality votes cache (paritytech#116)
Browse files Browse the repository at this point in the history
* removeInMemoryStorage + extract Kovan stuff to runtime

* removed comment from the future

* remove redundant conversions

* remove redundant `u8 as usize`

* remove redundant `u8 as usize`

* Update modules/ethereum/src/mock.rs

Co-authored-by: Hernando Castano <[email protected]>

* use hex-literal in kovan config

* cargo fmt --all

* extracted insert_header

* cargo fmt --all

* finality cache

* cargo fmt --all

* cargo fmt --all

* impl Default for FinalityVotes

Co-authored-by: Hernando Castano <[email protected]>
Co-authored-by: Hernando Castano <[email protected]>
  • Loading branch information
3 people authored and serban300 committed Apr 8, 2024
1 parent 8185975 commit c4b2674
Show file tree
Hide file tree
Showing 8 changed files with 819 additions and 277 deletions.
5 changes: 4 additions & 1 deletion bridges/bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,14 @@ impl pallet_aura::Trait for Runtime {
}

parameter_types! {
pub const FinalityVotesCachingInterval: Option<u64> = Some(16);
pub const KovanAuraConfiguration: pallet_bridge_eth_poa::AuraConfiguration = kovan::kovan_aura_configuration();
pub const KovanValidatorsConfiguration: pallet_bridge_eth_poa::ValidatorsConfiguration = kovan::kovan_validators_configuration();
}

impl pallet_bridge_eth_poa::Trait for Runtime {
type AuraConfiguration = KovanAuraConfiguration;
type FinalityVotesCachingInterval = FinalityVotesCachingInterval;
type ValidatorsConfiguration = KovanValidatorsConfiguration;
type OnHeadersSubmitted = ();
}
Expand Down Expand Up @@ -495,7 +497,8 @@ impl_runtime_apis! {

impl sp_bridge_eth_poa::EthereumHeadersApi<Block> for Runtime {
fn best_block() -> (u64, sp_bridge_eth_poa::H256) {
BridgeEthPoA::best_block()
let best_block = BridgeEthPoA::best_block();
(best_block.number, best_block.hash)
}

fn is_import_requires_receipts(header: sp_bridge_eth_poa::Header) -> bool {
Expand Down
Loading

0 comments on commit c4b2674

Please sign in to comment.