diff --git a/go/ct/gen/state.go b/go/ct/gen/state.go index 3ca99cbfc..d1633bd18 100644 --- a/go/ct/gen/state.go +++ b/go/ct/gen/state.go @@ -471,12 +471,6 @@ func (g *StateGenerator) generateWith(rnd *rand.Rand, assignment Assignment) (*s // Generate return data of last call resultLastCallReturnData := RandomBytes(rnd, st.MaxDataSize) - // Generate return data for terminal states. - var resultReturnData Bytes - if resultStatus == st.Stopped || resultStatus == st.Reverted { - resultReturnData = RandomBytes(rnd, st.MaxDataSize) - } - // Invoke SelfDestructedGenerator resultHasSelfdestructed, err := g.hasSelfDestructedGen.Generate(rnd) if err != nil { @@ -534,6 +528,7 @@ func (g *StateGenerator) generateWith(rnd *rand.Rand, assignment Assignment) (*s resultRevision := GetRevisionForBlock(resultBlockContext.BlockNumber) + // Return data is not set as it should only be set by RETURN/REVERT opcodes. result := st.NewState(resultCode) result.Status = resultStatus result.Revision = resultRevision @@ -552,7 +547,6 @@ func (g *StateGenerator) generateWith(rnd *rand.Rand, assignment Assignment) (*s result.TransactionContext = resultTransactionContext result.CallData = resultCallData result.LastCallReturnData = resultLastCallReturnData - result.ReturnData = resultReturnData result.HasSelfDestructed = resultHasSelfdestructed result.RecentBlockHashes = resultRecentBlockHashes diff --git a/go/ct/spc/specification.go b/go/ct/spc/specification.go index 4388093b1..f8f645836 100644 --- a/go/ct/spc/specification.go +++ b/go/ct/spc/specification.go @@ -130,6 +130,7 @@ func getAllRules() []Rule { ), Effect: Change(func(s *st.State) { s.Status = st.Stopped + s.ReturnData = Bytes{} s.Pc++ }), }) diff --git a/regression_inputs/no_code_#958.json b/regression_inputs/no_code_#958.json index 64423710d..209df2626 100644 --- a/regression_inputs/no_code_#958.json +++ b/regression_inputs/no_code_#958.json @@ -12,6 +12,5 @@ "44e536d9beb6692f f1771bc7786d984f e8121ed7845eb679 7481234b5f8357fc", "a4908db06f82ce80 fa765578d53df1b1 79aa3a06d8ea630a 5946bb7a396ca860", "5567e6eac386c167 503cbc87f4045ae3 03416fcf004cb556 f2339e0f9dad807a" - ], - "ReturnData": "3078" + ] } \ No newline at end of file