aboutsummaryrefslogtreecommitdiff
path: root/plugin/evm/block.go
diff options
context:
space:
mode:
authorStephenButtolph <[email protected]>2020-08-25 13:20:28 -0400
committerStephenButtolph <[email protected]>2020-08-25 13:20:28 -0400
commitb05d11d451fb73843abcf6bd5fc8664b069433a4 (patch)
tree9de0af77831340eb38c28c613849f1e7b65f3a54 /plugin/evm/block.go
parentb53cf297e5cccd577af725bacdb7f3ccb61336bd (diff)
fixed potential vulnerability with bootstrapping blocks
Diffstat (limited to 'plugin/evm/block.go')
-rw-r--r--plugin/evm/block.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/plugin/evm/block.go b/plugin/evm/block.go
index 375dc6d..5c30fe1 100644
--- a/plugin/evm/block.go
+++ b/plugin/evm/block.go
@@ -74,10 +74,13 @@ func (b *Block) Parent() snowman.Block {
// Verify implements the snowman.Block interface
func (b *Block) Verify() error {
- // Ensure the minimum gas price is paid for every transaction
- for _, tx := range b.ethBlock.Transactions() {
- if tx.GasPrice().Cmp(minGasPrice) < 0 {
- return errInvalidBlock
+ // Only enforce a minimum fee when bootstrapping has finished
+ if b.vm.ctx.IsBootstrapped() {
+ // Ensure the minimum gas price is paid for every transaction
+ for _, tx := range b.ethBlock.Transactions() {
+ if tx.GasPrice().Cmp(minGasPrice) < 0 {
+ return errInvalidBlock
+ }
}
}