eth_filter flake debug

This commit is contained in:
Andrew Jackson (Ajax) 2023-09-08 11:17:51 -05:00
parent 8ab6eaa6e3
commit 7ef93448fb
2 changed files with 7 additions and 0 deletions

View File

@ -16,6 +16,7 @@ import (
"time" "time"
"github.com/ipfs/go-cid" "github.com/ipfs/go-cid"
logging "github.com/ipfs/go-log/v2"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"golang.org/x/xerrors" "golang.org/x/xerrors"
@ -543,6 +544,7 @@ func TestTxReceiptBloom(t *testing.T) {
kit.MockProofs(), kit.MockProofs(),
kit.ThroughRPC()) kit.ThroughRPC())
ens.InterconnectAll().BeginMining(blockTime) ens.InterconnectAll().BeginMining(blockTime)
logging.SetLogLevel("fullnode", "DEBUG")
ctx, cancel := context.WithTimeout(context.Background(), time.Minute) ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
defer cancel() defer cancel()
@ -577,6 +579,10 @@ func TestTxReceiptBloom(t *testing.T) {
} }
} }
// Deflake plan: (Flake: 5 bits instead of 6)
// Debug + search logs for "LogsBloom"
// compare to passing case.
//
// 3 bits from the topic, 3 bits from the address // 3 bits from the topic, 3 bits from the address
require.Equal(t, 6, bitsSet) require.Equal(t, 6, bitsSet)
} }

View File

@ -665,6 +665,7 @@ func newEthTxReceipt(ctx context.Context, tx ethtypes.EthTx, lookup *api.MsgLook
continue continue
} }
for _, topic := range topics { for _, topic := range topics {
log.Debug("LogsBloom set for ", topic)
ethtypes.EthBloomSet(receipt.LogsBloom, topic[:]) ethtypes.EthBloomSet(receipt.LogsBloom, topic[:])
} }
l.Data = data l.Data = data