reduce number of heap allocations in tracing (#958)

This commit is contained in:
HAOYUatHZ 2024-08-02 16:49:39 +08:00 committed by GitHub
parent 58ed1a2a3b
commit ddf94b3e5a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 0 additions and 26 deletions

View file

@ -92,24 +92,6 @@ type StructLogRes struct {
RefundCounter uint64 `json:"refund,omitempty"`
}
// NewStructLogResBasic Basic StructLogRes skeleton, Stack&Memory&Storage&ExtraData are separated from it for GC optimization;
// still need to fill in with Stack&Memory&Storage&ExtraData
func NewStructLogResBasic(pc uint64, op string, gas, gasCost uint64, depth int, refundCounter uint64, err error) *StructLogRes {
logRes := &StructLogRes{
Pc: pc,
Op: op,
Gas: gas,
GasCost: gasCost,
Depth: depth,
RefundCounter: refundCounter,
}
if err != nil {
logRes.Error = err.Error()
}
return logRes
}
type AccountWrapper struct {
Address common.Address `json:"address"`
Nonce uint64 `json:"nonce"`

View file

@ -80,14 +80,6 @@ type StructLog struct {
Err error `json:"-"`
}
func (s *StructLog) clean() {
s.Memory = s.Memory[:0]
s.Stack = s.Stack[:0]
s.ReturnData = s.ReturnData[:0]
s.Storage = nil
s.Err = nil
}
// overrides for gencodec
type structLogMarshaling struct {
Gas math.HexOrDecimal64