Skip to content

Commit

Permalink
Removes DefaultTestCachingConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoximenes committed May 24, 2024
1 parent 5536d22 commit 85de3d4
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 14 deletions.
6 changes: 0 additions & 6 deletions execution/gethexec/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,6 @@ var (
InvalidStateSchemeForArchive = errors.New("archive cannot be set when using path as the state-scheme")
)

func DefaultTestCachingConfig() CachingConfig {
c := DefaultCachingConfig
c.StateScheme = rawdb.PathScheme
return c
}

// TODO remove stack from parameters as it is no longer needed here
func DefaultCacheConfigFor(stack *node.Node, cachingConfig *CachingConfig) *core.CacheConfig {
baseConf := ethconfig.Defaults
Expand Down
2 changes: 0 additions & 2 deletions execution/gethexec/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ func ConfigDefaultNonSequencerTest() *Config {
config.Sequencer.Enable = false
config.Forwarder = DefaultTestForwarderConfig
config.ForwardingTarget = "null"
config.Caching = DefaultTestCachingConfig()

_ = config.Validate()

Expand All @@ -128,7 +127,6 @@ func ConfigDefaultTest() *Config {
config.Sequencer = TestSequencerConfig
config.ParentChainReader = headerreader.TestConfig
config.ForwardingTarget = "null"
config.Caching = DefaultTestCachingConfig()

_ = config.Validate()

Expand Down
6 changes: 3 additions & 3 deletions system_tests/das_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func TestDASRekey(t *testing.T) {
authorizeDASKeyset(t, ctx, pubkeyA, l1info, l1client)

// Setup L2 chain
cachingConfig := gethexec.DefaultTestCachingConfig()
cachingConfig := gethexec.TestCachingConfig
_, l2stackA, l2chainDb, l2arbDb, l2blockchain := createL2BlockChainWithStackConfig(t, l2info, nodeDir, chainConfig, initMessage, nil, &cachingConfig)
l2info.GenerateAccount("User2")

Expand Down Expand Up @@ -185,7 +185,7 @@ func TestDASRekey(t *testing.T) {
l2arbDb, err := l2stackA.OpenDatabaseWithExtraOptions("arbitrumdata", 0, 0, "arbitrumdata/", false, conf.PersistentConfigDefault.Pebble.ExtraOptions("arbitrumdata"))
Require(t, err)

cachingConfig := gethexec.DefaultTestCachingConfig()
cachingConfig := gethexec.TestCachingConfig
cacheConfig := gethexec.DefaultCacheConfigFor(nil, &cachingConfig)
l2blockchain, err := gethexec.GetBlockChain(l2chainDb, cacheConfig, chainConfig, gethexec.ConfigDefaultTest().TxLookupLimit)
Require(t, err)
Expand Down Expand Up @@ -320,7 +320,7 @@ func TestDASComplexConfigAndRestMirror(t *testing.T) {
Require(t, err)

// Setup L2 chain
cachingConfig := gethexec.DefaultTestCachingConfig()
cachingConfig := gethexec.TestCachingConfig
l2info, l2stackA, l2chainDb, l2arbDb, l2blockchain := createL2BlockChainWithStackConfig(t, nil, "", chainConfig, initMessage, nil, &cachingConfig)
l2info.GenerateAccount("User2")

Expand Down
2 changes: 1 addition & 1 deletion system_tests/full_challenge_impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ func RunChallengeTest(t *testing.T, asserterIsCorrect bool, useStubs bool, chall
conf.BatchPoster.Enable = false
conf.InboxReader.CheckDelay = time.Second

cachingConfig := gethexec.DefaultTestCachingConfig()
cachingConfig := gethexec.TestCachingConfig
var valStack *node.Node
var mockSpawn *mockSpawner
if useStubs {
Expand Down
2 changes: 1 addition & 1 deletion system_tests/nodeinterface_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func TestFindBatch(t *testing.T) {
rollupAddresses.Bridge = bridgeAddr
rollupAddresses.SequencerInbox = seqInboxAddr
l2Info := NewArbTestInfo(t, chainConfig.ChainID)
cachingConfig := gethexec.DefaultTestCachingConfig()
cachingConfig := gethexec.TestCachingConfig
consensus, _ := createL2Nodes(t, ctx, &cachingConfig, conf, chainConfig, l1Backend, l2Info, rollupAddresses, initMsg, nil, nil, fatalErrChan)
err := consensus.Start(ctx)
Require(t, err)
Expand Down
4 changes: 3 additions & 1 deletion system_tests/staterecovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ func TestRectreateMissingStates(t *testing.T) {
chainDb, err := stack.OpenDatabaseWithExtraOptions("l2chaindata", 0, 0, "l2chaindata/", false, conf.PersistentConfigDefault.Pebble.ExtraOptions("l2chaindata"))
Require(t, err)
defer chainDb.Close()
cacheConfig := gethexec.DefaultCacheConfigFor(stack, &gethexec.TestCachingConfig)
cachingConfig := gethexec.TestCachingConfig
cachingConfig.StateScheme = rawdb.HashScheme
cacheConfig := gethexec.DefaultCacheConfigFor(stack, &cachingConfig)
bc, err := gethexec.GetBlockChain(chainDb, cacheConfig, builder.chainConfig, builder.execConfig.TxLookupLimit)
Require(t, err)
err = staterecovery.RecreateMissingStates(chainDb, bc, cacheConfig, 1)
Expand Down

0 comments on commit 85de3d4

Please sign in to comment.