Skip to content

Commit

Permalink
set fetchReceiptUponEntry default to false
Browse files Browse the repository at this point in the history
Signed-off-by: Chengxuan Xing <chengxuan.xing@kaleido.io>
  • Loading branch information
Chengxuan committed Jun 11, 2024
1 parent 5f2a84a commit eb4e584
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
|Key|Description|Type|Default Value|
|---|-----------|----|-------------|
|blockQueueLength|Internal queue length for notifying the confirmations manager of new blocks|`int`|`50`
|fetchReceiptUponEntry|Fetch receipt of new transactions immediately when they are added to the internal queue. When set to false, fetch will only happen when a new block is received or the transaction has been queue for more than the stale receipt timeout|`boolean`|`true`
|fetchReceiptUponEntry|Fetch receipt of new transactions immediately when they are added to the internal queue. When set to false, fetch will only happen when a new block is received or the transaction has been queue for more than the stale receipt timeout|`boolean`|`false`
|notificationQueueLength|Internal queue length for notifying the confirmations manager of new transactions/events|`int`|`50`
|receiptWorkers|Number of workers to use to query in parallel for receipts|`int`|`10`
|required|Number of confirmations required to consider a transaction/event final|`int`|`20`
Expand Down
3 changes: 2 additions & 1 deletion internal/confirmations/confirmations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ func TestBlockConfirmationManagerE2EForkReNotifyConfirmations(t *testing.T) {

func TestBlockConfirmationManagerE2ETransactionMovedFork(t *testing.T) {
bcm, mca := newTestBlockConfirmationManager(t, true)
bcm.fetchReceiptUponEntry = true // mark fetch receipt upon entry to do a fetch receipt before any blocks were retrieved

confirmed := make(chan *apitypes.ConfirmationsNotification, 1)
receiptReceived := make(chan *ffcapi.TransactionReceiptResponse, 1)
Expand Down Expand Up @@ -643,7 +644,7 @@ func TestBlockConfirmationManagerE2ETransactionMovedFork(t *testing.T) {
bcm.Stop()

mca.AssertExpectations(t)

// false
}

func TestBlockConfirmationManagerE2EHistoricalEvent(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/tmconfig/tmconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func setDefaults() {
viper.SetDefault(string(ConfirmationsRetryInitDelay), "100ms")
viper.SetDefault(string(ConfirmationsRetryMaxDelay), "15s")
viper.SetDefault(string(ConfirmationsRetryFactor), 2.0)
viper.SetDefault(string(ConfirmationsFetchReceiptUponEntry), true)
viper.SetDefault(string(ConfirmationsFetchReceiptUponEntry), false)

viper.SetDefault(string(EventStreamsDefaultsBatchSize), 50)
viper.SetDefault(string(EventStreamsDefaultsBatchTimeout), "5s")
Expand Down

0 comments on commit eb4e584

Please sign in to comment.