From b8962d19f57e27cd83bf3651f0b1650185fcdf44 Mon Sep 17 00:00:00 2001 From: envestcc Date: Sun, 29 Sep 2024 22:24:44 +0800 Subject: [PATCH 1/2] blobtx cannot create contract --- action/protocol/execution/protocol.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/action/protocol/execution/protocol.go b/action/protocol/execution/protocol.go index 4e3b580bfd..51f8d79ac0 100644 --- a/action/protocol/execution/protocol.go +++ b/action/protocol/execution/protocol.go @@ -99,6 +99,9 @@ func (p *Protocol) Validate(ctx context.Context, elp action.Envelope, _ protocol if dataSize > sizeLimit { return action.ErrOversizedData } + if fCtx.EnableBlobTransaction && len(elp.BlobHashes()) > 0 && elp.To() == nil { + return errors.New("cannot create contract in blob tx") + } return nil } From bd9519f43017f27b659fba18fca1a4c1a762d777 Mon Sep 17 00:00:00 2001 From: envestcc Date: Mon, 30 Sep 2024 11:29:25 +0800 Subject: [PATCH 2/2] address comment --- action/protocol/execution/protocol.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action/protocol/execution/protocol.go b/action/protocol/execution/protocol.go index 51f8d79ac0..b17ee28013 100644 --- a/action/protocol/execution/protocol.go +++ b/action/protocol/execution/protocol.go @@ -99,7 +99,7 @@ func (p *Protocol) Validate(ctx context.Context, elp action.Envelope, _ protocol if dataSize > sizeLimit { return action.ErrOversizedData } - if fCtx.EnableBlobTransaction && len(elp.BlobHashes()) > 0 && elp.To() == nil { + if len(elp.BlobHashes()) > 0 && elp.To() == nil { return errors.New("cannot create contract in blob tx") } return nil