-
Notifications
You must be signed in to change notification settings - Fork 196
fix: Fix the GasEstimateMessageGas API
#6109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
947e657
f7e232e
ab7f29f
e4c32ea
1f87632
5ce5eaf
8e73d66
d5a8754
fa8af08
1615714
48c2ea8
33be1a5
7f3452b
291e4fe
06ff3fe
ea881dc
dbb91d0
ec9c48e
c9e4246
9d9f59b
e06aa75
eade8f6
c42c5ec
e2a5ad3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -1,15 +1,16 @@ | ||||||||
| // Copyright 2019-2025 ChainSafe Systems | ||||||||
| // SPDX-License-Identifier: Apache-2.0, MIT | ||||||||
|
|
||||||||
| use super::client::Client; | ||||||||
| use crate::db::db_engine::DbConfig; | ||||||||
| use crate::libp2p::Libp2pConfig; | ||||||||
| use crate::shim::clock::ChainEpoch; | ||||||||
| use crate::shim::econ::TokenAmount; | ||||||||
| use crate::utils::misc::env::is_env_set_and_truthy; | ||||||||
| use crate::{chain_sync::SyncConfig, networks::NetworkChain}; | ||||||||
| use serde::{Deserialize, Serialize}; | ||||||||
| use std::path::PathBuf; | ||||||||
|
|
||||||||
| use super::client::Client; | ||||||||
| use std::str::FromStr; | ||||||||
|
|
||||||||
| const FOREST_CHAIN_INDEXER_ENABLED: &str = "FOREST_CHAIN_INDEXER_ENABLED"; | ||||||||
|
|
||||||||
|
|
@@ -92,6 +93,25 @@ impl Default for ChainIndexerConfig { | |||||||
| } | ||||||||
| } | ||||||||
|
|
||||||||
| #[derive(Deserialize, Serialize, PartialEq, Eq, Debug, Clone)] | ||||||||
| #[cfg_attr(test, derive(derive_quickcheck_arbitrary::Arbitrary))] | ||||||||
| pub struct FeeConfig { | ||||||||
| #[serde(with = "crate::lotus_json")] | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||||||||
| pub max_fee: TokenAmount, | ||||||||
| } | ||||||||
|
|
||||||||
| impl Default for FeeConfig { | ||||||||
| fn default() -> Self { | ||||||||
| // This indicates the default max fee for a message, | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||||||||
| // The code is taken from https://github.com/filecoin-project/lotus/blob/release/v1.34.1/node/config/def.go#L39 | ||||||||
| Self { | ||||||||
| max_fee: TokenAmount::from_atto( | ||||||||
| num_bigint::BigInt::from_str("70000000000000000").unwrap(), | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are more performant initialization options for
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated. |
||||||||
| ), // 0.07 FIL | ||||||||
| } | ||||||||
| } | ||||||||
| } | ||||||||
|
|
||||||||
| #[derive(Serialize, Deserialize, PartialEq, Default, Debug, Clone)] | ||||||||
| #[cfg_attr(test, derive(derive_quickcheck_arbitrary::Arbitrary))] | ||||||||
| #[serde(default)] | ||||||||
|
|
@@ -104,6 +124,7 @@ pub struct Config { | |||||||
| pub daemon: DaemonConfig, | ||||||||
| pub events: EventsConfig, | ||||||||
| pub fevm: FevmConfig, | ||||||||
| pub fee: FeeConfig, | ||||||||
| pub chain_indexer: ChainIndexerConfig, | ||||||||
| } | ||||||||
|
|
||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -271,6 +271,7 @@ pub struct ChainConfig { | |
| pub f3_initial_power_table: Option<Cid>, | ||
| pub enable_indexer: bool, | ||
| pub enable_receipt_event_caching: bool, | ||
| pub default_max_fee: Option<TokenAmount>, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you explain why is this an
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was supposed to be the replacement for setting value to zero, but we can remove it and initialise with zero. |
||
| } | ||
|
|
||
| impl ChainConfig { | ||
|
|
@@ -304,6 +305,7 @@ impl ChainConfig { | |
| ), | ||
| enable_indexer: false, | ||
| enable_receipt_event_caching: true, | ||
| default_max_fee: None, | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -340,6 +342,7 @@ impl ChainConfig { | |
| ), | ||
| enable_indexer: false, | ||
| enable_receipt_event_caching: true, | ||
| default_max_fee: None, | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -366,6 +369,7 @@ impl ChainConfig { | |
| f3_initial_power_table: None, | ||
| enable_indexer: false, | ||
| enable_receipt_event_caching: true, | ||
| default_max_fee: None, | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -398,6 +402,7 @@ impl ChainConfig { | |
| f3_initial_power_table: None, | ||
| enable_indexer: false, | ||
| enable_receipt_event_caching: true, | ||
| default_max_fee: None, | ||
| } | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice