Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions eth/stagedsync/stage_bodies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"github.com/ledgerwatch/erigon-lib/config3"
"github.com/ledgerwatch/erigon-lib/kv"
"github.com/ledgerwatch/erigon-lib/kv/rawdbv3"
"github.com/ledgerwatch/erigon-lib/log/v3"
"github.com/stretchr/testify/require"

"github.com/ledgerwatch/erigon/core/rawdb"
Expand All @@ -50,6 +51,9 @@ func testingHeaderBody(t *testing.T) (h *types.Header, b *types.RawBody) {
}

func TestBodiesCanonical(t *testing.T) {
defer log.Root().SetHandler(log.Root().GetHandler())
log.Root().SetHandler(log.LvlFilterHandler(log.LvlError, log.StderrHandler))

m := mock.Mock(t)
tx, err := m.DB.BeginRw(m.Ctx)
require := require.New(t)
Expand Down
16 changes: 8 additions & 8 deletions eth/stagedsync/stage_bor_heimdall_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestBorHeimdallForwardPersistsSpans(t *testing.T) {
testHarness := stagedsynctest.InitHarness(ctx, t, stagedsynctest.HarnessCfg{
ChainConfig: stagedsynctest.BorDevnetChainConfigWithNoBlockSealDelays(),
GenerateChainNumBlocks: numBlocks,
LogLvl: log.LvlInfo,
LogLvl: log.LvlError,
})
// pretend-update previous stage progress
testHarness.SaveStageProgress(ctx, t, stages.Headers, uint64(numBlocks))
Expand Down Expand Up @@ -77,7 +77,7 @@ func TestBorHeimdallForwardFetchesFirstSpanDuringSecondSprintStart(t *testing.T)
testHarness := stagedsynctest.InitHarness(ctx, t, stagedsynctest.HarnessCfg{
ChainConfig: stagedsynctest.BorDevnetChainConfigWithNoBlockSealDelays(),
GenerateChainNumBlocks: numBlocks,
LogLvl: log.LvlInfo,
LogLvl: log.LvlError,
})
// pretend-update previous stage progress
testHarness.SaveStageProgress(ctx, t, stages.Headers, uint64(numBlocks))
Expand Down Expand Up @@ -112,7 +112,7 @@ func TestBorHeimdallForwardFetchesFirstSpanAfterSecondSprintStart(t *testing.T)
testHarness := stagedsynctest.InitHarness(ctx, t, stagedsynctest.HarnessCfg{
ChainConfig: stagedsynctest.BorDevnetChainConfigWithNoBlockSealDelays(),
GenerateChainNumBlocks: numBlocks,
LogLvl: log.LvlInfo,
LogLvl: log.LvlError,
})
// pretend-update previous stage progress
testHarness.SaveStageProgress(ctx, t, stages.Headers, uint64(numBlocks))
Expand Down Expand Up @@ -143,7 +143,7 @@ func TestBorHeimdallForwardFetchesNextSpanDuringLastSprintOfCurrentSpan(t *testi
testHarness := stagedsynctest.InitHarness(ctx, t, stagedsynctest.HarnessCfg{
ChainConfig: stagedsynctest.BorDevnetChainConfigWithNoBlockSealDelays(),
GenerateChainNumBlocks: numBlocks,
LogLvl: log.LvlInfo,
LogLvl: log.LvlError,
})
// pretend-update previous stage progress
testHarness.SaveStageProgress(ctx, t, stages.Headers, uint64(numBlocks))
Expand Down Expand Up @@ -174,7 +174,7 @@ func TestBorHeimdallForwardPersistsStateSyncEvents(t *testing.T) {
testHarness := stagedsynctest.InitHarness(ctx, t, stagedsynctest.HarnessCfg{
ChainConfig: stagedsynctest.BorDevnetChainConfigWithNoBlockSealDelays(),
GenerateChainNumBlocks: numBlocks,
LogLvl: log.LvlInfo,
LogLvl: log.LvlError,
})
// pretend-update previous stage progress
testHarness.SaveStageProgress(ctx, t, stages.Headers, uint64(numBlocks))
Expand Down Expand Up @@ -211,7 +211,7 @@ func TestBorHeimdallForwardErrHeaderValidatorsLengthMismatch(t *testing.T) {
testHarness := stagedsynctest.InitHarness(ctx, t, stagedsynctest.HarnessCfg{
ChainConfig: stagedsynctest.BorDevnetChainConfigWithNoBlockSealDelays(),
GenerateChainNumBlocks: numBlocks,
LogLvl: log.LvlInfo,
LogLvl: log.LvlError,
HeimdallProducersOverride: map[uint64][]valset.Validator{
1: {
*valset.NewValidator(crypto.PubkeyToAddress(validatorKey1.PublicKey), 1),
Expand All @@ -236,7 +236,7 @@ func TestBorHeimdallForwardErrHeaderValidatorsBytesMismatch(t *testing.T) {
testHarness := stagedsynctest.InitHarness(ctx, t, stagedsynctest.HarnessCfg{
ChainConfig: stagedsynctest.BorDevnetChainConfigWithNoBlockSealDelays(),
GenerateChainNumBlocks: numBlocks,
LogLvl: log.LvlInfo,
LogLvl: log.LvlError,
HeimdallProducersOverride: map[uint64][]valset.Validator{
1: {
*valset.NewValidator(crypto.PubkeyToAddress(validatorKey1.PublicKey), 1),
Expand All @@ -260,7 +260,7 @@ func TestBorHeimdallForwardDetectsUnauthorizedSignerError(t *testing.T) {
testHarness := stagedsynctest.InitHarness(ctx, t, stagedsynctest.HarnessCfg{
ChainConfig: chainConfig,
GenerateChainNumBlocks: numBlocks,
LogLvl: log.LvlInfo,
LogLvl: log.LvlError,
})

// prepare invalid header and insert it in the db
Expand Down
4 changes: 2 additions & 2 deletions eth/stagedsync/stage_mining_bor_heimdall_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestMiningBorHeimdallForwardPersistsSpans(t *testing.T) {
testHarness := stagedsynctest.InitHarness(ctx, t, stagedsynctest.HarnessCfg{
ChainConfig: stagedsynctest.BorDevnetChainConfigWithNoBlockSealDelays(),
GenerateChainNumBlocks: numBlocks,
LogLvl: log.LvlInfo,
LogLvl: log.LvlError,
})
// pretend-update previous stage progress
testHarness.SetMiningBlockEmptyHeader(ctx, t, uint64(numBlocks))
Expand Down Expand Up @@ -69,7 +69,7 @@ func TestMiningBorHeimdallForwardPersistsStateSyncEvents(t *testing.T) {
testHarness := stagedsynctest.InitHarness(ctx, t, stagedsynctest.HarnessCfg{
ChainConfig: stagedsynctest.BorDevnetChainConfigWithNoBlockSealDelays(),
GenerateChainNumBlocks: numBlocks,
LogLvl: log.LvlInfo,
LogLvl: log.LvlError,
})
// pretend-update previous stage progress
testHarness.SetMiningBlockEmptyHeader(ctx, t, uint64(numBlocks))
Expand Down
3 changes: 2 additions & 1 deletion turbo/stages/mock/mock_sentry.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ func MockWithEverything(tb testing.TB, gspec *types.Genesis, key *ecdsa.PrivateK
cfg.DeprecatedTxPool.Disable = !withTxPool
cfg.DeprecatedTxPool.StartOnInit = true

logger := log.New()
logger := log.Root()
logger.SetHandler(log.LvlFilterHandler(log.LvlError, log.StderrHandler))

ctx, ctxCancel := context.WithCancel(context.Background())
db, agg := temporaltest.NewTestDB(nil, dirs)
Expand Down