Skip to content

Commit

Permalink
RETURNCONTRACT todos and notes
Browse files Browse the repository at this point in the history
  • Loading branch information
racytech committed Nov 22, 2023
1 parent 3e66353 commit 55ef3ca
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/vm/eips.go
Original file line number Diff line number Diff line change
Expand Up @@ -668,9 +668,13 @@ func opReturnContract(pc *uint64, interpreter *EVMInterpreter, scope *ScopeConte
auxData = scope.Memory.GetPtr(int64(auxDataOffset.Uint64()), int64(auxDataSize.Uint64()))
)
var c Container
// NOTE(racytech): UnmarshalBinary checks for correct EOF format
// but it decodes entire container, which is a bit expensive. Do we need that?
// Can we do better?
if err := c.UnmarshalBinary(deployContainer); err != nil {
return nil, fmt.Errorf("%w: %v", ErrInvalidEOFInitcode, err)
}
c.Data = append(c.Data, auxData...)
// TODO(racytech): make sure this one refers to the same underlying slice as Container.SubContainer[deployContainerIdx]
deployContainer = append(deployContainer, auxData...)
return nil, nil
}

0 comments on commit 55ef3ca

Please sign in to comment.