metachris / flashbotsrpc

Golang client for Flashbots Relay, mev-geth and standard Ethereum JSON-RPC API endpoints
https://docs.flashbots.net/flashbots-auction/searchers/advanced/rpc-endpoint/
MIT License
165 stars 55 forks source link

why need to strip beginning bytes #13

Closed github1youlc closed 1 year ago

github1youlc commented 2 years ago

I'm confused with the following code. I have tried to figure out why need to strip rlp-encoded beginning bytes, but failed. Wish for your detail !!!

https://github.com/metachris/flashbotsrpc/blob/master/flashbotsrpc.go#L681

    // Might need to strip beginning bytes
    if rlp[:2] == "b9" {
        rlp = rlp[6:]
    } else if rlp[:2] == "b8" {
        rlp = rlp[4:]
    }
metachris commented 2 years ago

I don't quite recall anymore, there were some errors otherwise. You could try to remove the code and run a few blocks through it to reproduce.