File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
packages/node/src/plugins/autostaker Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ Changes before Tatum release are not documented in this file.
1212
1313#### Added
1414
15+ - Transaction timeouts in Autostaker (https://github.com/streamr-dev/network/pull/3236 )
16+
1517#### Changed
1618
1719#### Deprecated
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ const MIN_SPONSORSHIP_TOTAL_PAYOUT_PER_SECOND = 1000000000000n
5353const ACTION_SUBMIT_RETRY_COUNT = 5
5454const ACTION_SUBMIT_RETRY_DELAY_MS = 5000
5555const ACTION_GAS_LIMIT_BUMP_PCT = 20
56+ const TRANSACTION_TIMEOUT = 60 * 1000
5657
5758const fetchMinStakePerSponsorship = async ( theGraphClient : TheGraphClient ) : Promise < bigint > => {
5859 const queryResult = await theGraphClient . queryEntity < { network : { minimumStakeWei : string } } > ( {
@@ -73,7 +74,8 @@ const getStakeOrUnstakeFunction = (action: Action): (
7374 sponsorshipContractAddress : string ,
7475 amount : WeiAmount ,
7576 bumpGasLimitPct : number ,
76- onSubmit : ( tx : ContractTransactionResponse ) => void
77+ onSubmit : ( tx : ContractTransactionResponse ) => void ,
78+ transactionTimeout ?: number
7779) => Promise < ContractTransactionReceipt | null > => {
7880 switch ( action . type ) {
7981 case 'stake' :
@@ -148,7 +150,8 @@ export class AutostakerPlugin extends Plugin<AutostakerPluginConfig> {
148150 // be staking/unstaking at the same time, so we bump the gas limit to be safe
149151 ACTION_GAS_LIMIT_BUMP_PCT ,
150152 // resolve on the onSubmit callback (=tx is broadcasted) instead of when the stakeOrUnstakeFunction resolves (=tx is mined)
151- ( tx ) => resolve ( tx )
153+ ( tx ) => resolve ( tx ) ,
154+ TRANSACTION_TIMEOUT
152155 ) . catch ( reject )
153156 } )
154157 }
You can’t perform that action at this time.
0 commit comments