11// Copyright 2019-2025 ChainSafe Systems
22// SPDX-License-Identifier: Apache-2.0, MIT
33
4+ use super :: client:: Client ;
45use crate :: db:: db_engine:: DbConfig ;
56use crate :: libp2p:: Libp2pConfig ;
67use crate :: shim:: clock:: ChainEpoch ;
8+ use crate :: shim:: econ:: TokenAmount ;
79use crate :: utils:: misc:: env:: is_env_set_and_truthy;
810use crate :: { chain_sync:: SyncConfig , networks:: NetworkChain } ;
911use serde:: { Deserialize , Serialize } ;
1012use std:: path:: PathBuf ;
1113
12- use super :: client:: Client ;
13-
1414const FOREST_CHAIN_INDEXER_ENABLED : & str = "FOREST_CHAIN_INDEXER_ENABLED" ;
1515
1616/// Structure that defines daemon configuration when process is detached
@@ -92,6 +92,23 @@ impl Default for ChainIndexerConfig {
9292 }
9393}
9494
95+ #[ derive( Deserialize , Serialize , PartialEq , Eq , Debug , Clone ) ]
96+ #[ cfg_attr( test, derive( derive_quickcheck_arbitrary:: Arbitrary ) ) ]
97+ pub struct FeeConfig {
98+ /// Indicates the default max fee for a message
99+ #[ serde( with = "crate::lotus_json" ) ]
100+ pub max_fee : TokenAmount ,
101+ }
102+
103+ impl Default for FeeConfig {
104+ fn default ( ) -> Self {
105+ // The code is taken from https://github.com/filecoin-project/lotus/blob/release/v1.34.1/node/config/def.go#L39
106+ Self {
107+ max_fee : TokenAmount :: from_atto ( 70_000_000_000_000_000u64 ) , // 0.07 FIL
108+ }
109+ }
110+ }
111+
95112#[ derive( Serialize , Deserialize , PartialEq , Default , Debug , Clone ) ]
96113#[ cfg_attr( test, derive( derive_quickcheck_arbitrary:: Arbitrary ) ) ]
97114#[ serde( default ) ]
@@ -104,6 +121,7 @@ pub struct Config {
104121 pub daemon : DaemonConfig ,
105122 pub events : EventsConfig ,
106123 pub fevm : FevmConfig ,
124+ pub fee : FeeConfig ,
107125 pub chain_indexer : ChainIndexerConfig ,
108126}
109127
0 commit comments