Skip to content

Commit

Permalink
Changes based on PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
amsanghi committed Nov 12, 2024
1 parent 6582070 commit 190c916
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
11 changes: 5 additions & 6 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,10 @@ var (
)

const (
bodyCacheLimit = 256
blockCacheLimit = 256
receiptsCacheLimit = 32
txLookupCacheLimit = 1024
DefaultTriesInMemory = 128
bodyCacheLimit = 256
blockCacheLimit = 256
receiptsCacheLimit = 32
txLookupCacheLimit = 1024

// BlockChainVersion ensures that an incompatible database forces a resync from scratch.
//
Expand Down Expand Up @@ -186,7 +185,7 @@ func (c *CacheConfig) triedbConfig(isVerkle bool) *triedb.Config {
var defaultCacheConfig = &CacheConfig{

// Arbitrum Config Options
TriesInMemory: DefaultTriesInMemory,
TriesInMemory: state.DefaultTriesInMemory,
TrieRetention: 30 * time.Minute,
MaxNumberOfBlocksToSkipStateSaving: 0,
MaxAmountOfGasToSkipStateSaving: 0,
Expand Down
6 changes: 3 additions & 3 deletions core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import (
)

// TriesInMemory represents the number of layers that are kept in RAM.
const TriesInMemory = 128
const DefaultTriesInMemory = 128

type revision struct {
id int
Expand Down Expand Up @@ -1374,8 +1374,8 @@ func (s *StateDB) Commit(block uint64, deleteEmptyObjects bool) (common.Hash, er
// - head layer is paired with HEAD state
// - head-1 layer is paired with HEAD-1 state
// - head-127 layer(bottom-most diff layer) is paired with HEAD-127 state
if err := s.snaps.Cap(root, TriesInMemory); err != nil {
log.Warn("Failed to cap snapshot tree", "root", root, "layers", TriesInMemory, "err", err)
if err := s.snaps.Cap(root, DefaultTriesInMemory); err != nil {
log.Warn("Failed to cap snapshot tree", "root", root, "layers", DefaultTriesInMemory, "err", err)
}
}
s.SnapshotCommits += time.Since(start)
Expand Down
1 change: 1 addition & 0 deletions core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {
fee := new(uint256.Int).SetUint64(st.gasUsed())
fee.Mul(fee, effectiveTipU256)
st.state.AddBalance(st.evm.Context.Coinbase, fee, tracing.BalanceIncreaseRewardTransactionFee)
tipAmount = fee.ToBig()
}

// Arbitrum: record the tip
Expand Down

0 comments on commit 190c916

Please sign in to comment.