Skip to content

Commit

Permalink
Merge branch 'master' into bump-avalanchego
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronbuchwald authored Apr 5, 2023
2 parents 3b06e8c + b182d9e commit a49dd78
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- '*'

jobs:
release:
Expand Down
6 changes: 3 additions & 3 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1356,9 +1356,9 @@ func (bc *BlockChain) insertBlock(block *types.Block, writes bool) error {
storageUpdateTimer.Inc(statedb.StorageUpdates.Milliseconds()) // Storage updates are complete, we can mark them
accountHashTimer.Inc(statedb.AccountHashes.Milliseconds()) // Account hashes are complete, we can mark them
storageHashTimer.Inc(statedb.StorageHashes.Milliseconds()) // Storage hashes are complete, we can mark them
additionalTrieProc := statedb.AccountHashes + statedb.StorageHashes + statedb.AccountUpdates + statedb.StorageUpdates - trieproc
blockStateValidationTimer.Inc((time.Since(substart) - additionalTrieProc).Milliseconds())
blockTrieOpsTimer.Inc((trieproc + additionalTrieProc).Milliseconds())
validationTrieProcTime := statedb.AccountHashes + statedb.StorageHashes + statedb.AccountUpdates + statedb.StorageUpdates - trieproc
blockStateValidationTimer.Inc((time.Since(substart) - validationTrieProcTime).Milliseconds())
blockTrieOpsTimer.Inc((trieproc + validationTrieProcTime).Milliseconds())

// If [writes] are disabled, skip [writeBlockWithState] so that we do not write the block
// or the state trie to disk.
Expand Down
11 changes: 5 additions & 6 deletions plugin/evm/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,6 @@ func (b *Block) ShouldVerifyWithContext(context.Context) (bool, error) {

// VerifyWithContext implements the block.WithVerifyContext interface
func (b *Block) VerifyWithContext(ctx context.Context, proposerVMBlockCtx *block.Context) error {
if proposerVMBlockCtx != nil {
log.Debug("Verifying block with context", "block", b.ID(), "height", b.Height())
} else {
log.Debug("Verifying block without context", "block", b.ID(), "height", b.Height())
}

return b.verify(&precompileconfig.ProposerPredicateContext{
PrecompilePredicateContext: precompileconfig.PrecompilePredicateContext{
SnowCtx: b.vm.ctx,
Expand All @@ -220,6 +214,11 @@ func (b *Block) VerifyWithContext(ctx context.Context, proposerVMBlockCtx *block
// Enforces that the predicates are valid within [predicateContext].
// Writes the block details to disk and the state to the trie manager iff writes=true.
func (b *Block) verify(predicateContext *precompileconfig.ProposerPredicateContext, writes bool) error {
if predicateContext.ProposerVMBlockCtx != nil {
log.Debug("Verifying block with context", "block", b.ID(), "height", b.Height())
} else {
log.Debug("Verifying block without context", "block", b.ID(), "height", b.Height())
}
if err := b.syntacticVerify(); err != nil {
return fmt.Errorf("syntactic block verification failed: %w", err)
}
Expand Down
2 changes: 0 additions & 2 deletions plugin/evm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ const (
defaultPopulateMissingTriesParallelism = 1024
defaultStateSyncServerTrieCache = 64 // MB
defaultAcceptedCacheSize = 32 // blocks
defaultWarpAPIEnabled = true

// defaultStateSyncMinBlocks is the minimum number of blocks the blockchain
// should be ahead of local last accepted to perform state sync.
Expand Down Expand Up @@ -225,7 +224,6 @@ func (c *Config) SetDefaults() {
c.RPCGasCap = defaultRpcGasCap
c.RPCTxFeeCap = defaultRpcTxFeeCap
c.MetricsExpensiveEnabled = defaultMetricsExpensiveEnabled
c.WarpAPIEnabled = defaultWarpAPIEnabled

c.TxPoolJournal = core.DefaultTxPoolConfig.Journal
c.TxPoolRejournal = Duration{core.DefaultTxPoolConfig.Rejournal}
Expand Down

0 comments on commit a49dd78

Please sign in to comment.