Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

remove confidence wait for StateWait in Lotus #262

Merged
merged 2 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions src/lotus/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ mod methods {
}

/// The default state wait confidence value
/// TODO: we can afford 2 epochs confidence (and even one)
/// with Mir, but with Filecoin mainnet this should be increased
/// NOTE: we can afford 0 epochs confidence (and even one)
/// with instant-finality consensus, but with Filecoin mainnet this should be increased
/// in case there are reorgs.
const STATE_WAIT_CONFIDENCE: u8 = 2;
const STATE_WAIT_CONFIDENCE: u8 = 0;
/// We dont set a limit on the look back epoch, i.e. check against latest block
const STATE_WAIT_LOOK_BACK_NO_LIMIT: i8 = -1;
/// We are not replacing any previous messages.
Expand Down
12 changes: 11 additions & 1 deletion src/manager/evm/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: MIT
use std::collections::HashMap;
use std::sync::{Arc, RwLock};
use std::time::Duration;

pub use crate::manager::evm::{ethers_address_to_fil_address, fil_to_eth_amount};
use anyhow::{anyhow, Result};
Expand Down Expand Up @@ -29,6 +30,11 @@ use crate::manager::{EthManager, SubnetManager};

pub type DefaultSignerMiddleware = SignerMiddleware<Provider<Http>, Wallet<SigningKey>>;

/// Default polling time used by the Ethers provider to check for pending
/// transactions and events. Default is 7, and for our child subnets we
/// can reduce it to the block time (or potentially less)
const ETH_PROVIDER_POLLING_TIME: Duration = Duration::from_secs(1);

/// The majority vote percentage for checkpoint submission when creating a subnet.
const SUBNET_MAJORITY_PERCENTAGE: u8 = 60;
const TRANSACTION_RECEIPT_RETRIES: usize = 10;
Expand Down Expand Up @@ -681,7 +687,11 @@ impl EthSubnetManager {
Http::new(url)
};

let provider = Provider::new(provider);
let mut provider = Provider::new(provider);
// set polling interval for provider to fit fast child subnets block times.
// TODO: We may want to make it dynamic so it adjusts depending on the type of network
// so we don't have a too slow or too fast polling for the underlying block times.
provider.set_interval(ETH_PROVIDER_POLLING_TIME);
let gateway_address = payload_to_evm_address(config.gateway_addr.payload())?;
let registry_address = payload_to_evm_address(config.registry_addr.payload())?;

Expand Down