From 451b02122afbbd6cae983de6bc9e624179fbcdf2 Mon Sep 17 00:00:00 2001
From: Evgeniy Stratonikov <evgeniy@nspcc.ru>
Date: Wed, 7 Jul 2021 16:14:49 +0300
Subject: [PATCH 1/2] *: increase GAS for verification

Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
---
 pkg/core/blockchain.go       | 4 ++--
 pkg/core/native/policy.go    | 2 +-
 pkg/core/stateroot/module.go | 2 +-
 pkg/network/extpool/pool.go  | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/pkg/core/blockchain.go b/pkg/core/blockchain.go
index 46e711615..cf3d3548d 100644
--- a/pkg/core/blockchain.go
+++ b/pkg/core/blockchain.go
@@ -50,7 +50,7 @@ const (
 	defaultMaxBlockSystemFee               = 900000000000
 	defaultMaxTraceableBlocks              = 2102400 // 1 year of 15s blocks
 	defaultMaxTransactionsPerBlock         = 512
-	verificationGasLimit                   = 100000000 // 1 GAS
+	headerVerificationGasLimit             = 3_00000000 // 3 GAS
 )
 
 var (
@@ -1874,7 +1874,7 @@ func (bc *Blockchain) verifyHeaderWitnesses(currHeader, prevHeader *block.Header
 	} else {
 		hash = prevHeader.NextConsensus
 	}
-	return bc.VerifyWitness(hash, currHeader, &currHeader.Script, verificationGasLimit)
+	return bc.VerifyWitness(hash, currHeader, &currHeader.Script, headerVerificationGasLimit)
 }
 
 // GoverningTokenHash returns the governing token (NEO) native contract hash.
diff --git a/pkg/core/native/policy.go b/pkg/core/native/policy.go
index 78f346605..5135a6b5c 100644
--- a/pkg/core/native/policy.go
+++ b/pkg/core/native/policy.go
@@ -23,7 +23,7 @@ const (
 
 	defaultExecFeeFactor      = interop.DefaultBaseExecFee
 	defaultFeePerByte         = 1000
-	defaultMaxVerificationGas = 50000000
+	defaultMaxVerificationGas = 1_50000000
 	// DefaultStoragePrice is the price to pay for 1 byte of storage.
 	DefaultStoragePrice = 100000
 
diff --git a/pkg/core/stateroot/module.go b/pkg/core/stateroot/module.go
index 668cef8af..530dbf583 100644
--- a/pkg/core/stateroot/module.go
+++ b/pkg/core/stateroot/module.go
@@ -156,7 +156,7 @@ func (s *Module) VerifyStateRoot(r *state.MPTRoot) error {
 	return s.verifyWitness(r)
 }
 
-const maxVerificationGAS = 1_00000000
+const maxVerificationGAS = 2_00000000
 
 // verifyWitness verifies state root witness.
 func (s *Module) verifyWitness(r *state.MPTRoot) error {
diff --git a/pkg/network/extpool/pool.go b/pkg/network/extpool/pool.go
index 82a1cf77f..bbf315fd2 100644
--- a/pkg/network/extpool/pool.go
+++ b/pkg/network/extpool/pool.go
@@ -99,7 +99,7 @@ func (p *Pool) Get(h util.Uint256) *payload.Extensible {
 	return elem.Value.(*payload.Extensible)
 }
 
-const extensibleVerifyMaxGAS = 2000000
+const extensibleVerifyMaxGAS = 6000000
 
 // RemoveStale removes invalid payloads after block processing.
 func (p *Pool) RemoveStale(index uint32) {

From 2cd5b63f0b7c505b92f4ecd0f72fe018a235a58e Mon Sep 17 00:00:00 2001
From: Evgeniy Stratonikov <evgeniy@nspcc.ru>
Date: Thu, 8 Jul 2021 10:06:10 +0300
Subject: [PATCH 2/2] policy: fix max exec fee

Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
---
 pkg/core/native/policy.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkg/core/native/policy.go b/pkg/core/native/policy.go
index 5135a6b5c..48b1db4ad 100644
--- a/pkg/core/native/policy.go
+++ b/pkg/core/native/policy.go
@@ -28,7 +28,7 @@ const (
 	DefaultStoragePrice = 100000
 
 	// maxExecFeeFactor is the maximum allowed execution fee factor.
-	maxExecFeeFactor = 1000
+	maxExecFeeFactor = 100
 	// maxFeePerByte is the maximum allowed fee per byte value.
 	maxFeePerByte = 100_000_000
 	// maxStoragePrice is the maximum allowed price for a byte of storage.