@@ -22,7 +22,6 @@ import (
2222 "github.com/ethereum/go-ethereum/common"
2323 ethTypes "github.com/ethereum/go-ethereum/core/types"
2424 "github.com/ethereum/go-ethereum/log"
25- "github.com/ethereum/go-ethereum/rlp"
2625)
2726
2827type ProxyServer struct {
@@ -196,11 +195,13 @@ func (p *ProxyServer) OverrideRequest(method string, rawParams json.RawMessage)
196195 return false , nil , fmt .Errorf ("failed to decode hex: %w" , err )
197196 }
198197
199- err = rlp .DecodeBytes (rawTxBytes , & tx )
198+ // Use UnmarshalBinary to support both legacy and typed (EIP-2718) transactions.
199+ // The previous rlp.DecodeBytes only handled legacy transactions.
200+ err = tx .UnmarshalBinary (rawTxBytes )
200201
201202 if err != nil {
202- p .log .Error ("failed to decode RLP " , "err" , err )
203- return false , nil , fmt .Errorf ("failed to decode RLP : %w" , err )
203+ p .log .Error ("failed to decode transaction " , "err" , err )
204+ return false , nil , fmt .Errorf ("failed to decode transaction : %w" , err )
204205 }
205206
206207 p .pendingTxs = append (p .pendingTxs , & tx )
@@ -217,21 +218,21 @@ func (p *ProxyServer) DebugResponse(method string, params json.RawMessage, respB
217218 p .log .Debug ("method" , "method" , method )
218219 p .log .Debug ("params" , "params" , params )
219220
220- // Try gzip decompression; fall back to raw body if the response is plain JSON.
221221 gzipReader , err := gzip .NewReader (bytes .NewReader (respBody ))
222222 if err != nil {
223- p .log .Debug ( "Response body " , "body " , string ( respBody ) )
223+ p .log .Error ( "Error creating gzip reader " , "err " , err )
224224 return
225225 }
226226 defer func () {
227227 if err := gzipReader .Close (); err != nil {
228- p .log .Debug ("Error closing gzip reader" , "err" , err )
228+ p .log .Error ("Error closing gzip reader" , "err" , err )
229229 }
230230 }()
231231
232232 uncompressedBody , err := io .ReadAll (gzipReader )
233+
233234 if err != nil {
234- p .log .Debug ("Error reading uncompressed response body" , "err" , err )
235+ p .log .Error ("Error reading uncompressed response body" , "err" , err )
235236 return
236237 }
237238 p .log .Debug ("Uncompressed body" , "body" , string (uncompressedBody ))
0 commit comments