Skip to content

Commit

Permalink
Merge branch 'ethereum:master' into portal
Browse files Browse the repository at this point in the history
  • Loading branch information
GrapeBaBa authored Nov 8, 2024
2 parents 2fabade + e92e22a commit dbe8ce7
Show file tree
Hide file tree
Showing 8 changed files with 299 additions and 169 deletions.
2 changes: 1 addition & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ var (
Usage: "Target EL engine API URL",
Category: flags.BeaconCategory,
}
BlsyncJWTSecretFlag = &cli.StringFlag{
BlsyncJWTSecretFlag = &flags.DirectoryFlag{
Name: "blsync.jwtsecret",
Usage: "Path to a JWT secret to use for target engine API endpoint",
Category: flags.BeaconCategory,
Expand Down
2 changes: 1 addition & 1 deletion core/state/statedb_hooked.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func (s *hookedStateDB) Snapshot() int {
}

func (s *hookedStateDB) AddPreimage(hash common.Hash, bytes []byte) {
s.inner.Snapshot()
s.inner.AddPreimage(hash, bytes)
}

func (s *hookedStateDB) Witness() *stateless.Witness {
Expand Down
17 changes: 17 additions & 0 deletions ethclient/ethclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,23 @@ func (ec *Client) SendTransaction(ctx context.Context, tx *types.Transaction) er
return ec.c.CallContext(ctx, nil, "eth_sendRawTransaction", hexutil.Encode(data))
}

// RevertErrorData returns the 'revert reason' data of a contract call.
//
// This can be used with CallContract and EstimateGas, and only when the server is Geth.
func RevertErrorData(err error) ([]byte, bool) {
var ec rpc.Error
var ed rpc.DataError
if errors.As(err, &ec) && errors.As(err, &ed) && ec.ErrorCode() == 3 {
if eds, ok := ed.ErrorData().(string); ok {
revertData, err := hexutil.Decode(eds)
if err == nil {
return revertData, true
}
}
}
return nil, false
}

func toBlockNumArg(number *big.Int) string {
if number == nil {
return "latest"
Expand Down
Loading

0 comments on commit dbe8ce7

Please sign in to comment.