Skip to content

Commit

Permalink
Warp prep nits (#606)
Browse files Browse the repository at this point in the history
* Move verifyWithContext debug log to correct location

* Disable warp API by default
  • Loading branch information
aaronbuchwald authored Apr 5, 2023
1 parent fcf241c commit b182d9e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
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 b182d9e

Please sign in to comment.