Removed special delegate value logic as it's not needed, the tracer does the correct thing

This commit is contained in:
Matthieu Vachon 2024-01-10 20:52:19 -05:00
parent 4c221a04d4
commit 8677894b94
2 changed files with 8 additions and 10 deletions

View file

@ -22,6 +22,7 @@ import (
"runtime" "runtime"
"strings" "strings"
"github.com/ethereum/go-ethereum/eth/tracers"
"github.com/ethereum/go-ethereum/internal/version" "github.com/ethereum/go-ethereum/internal/version"
"github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/params"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
@ -57,7 +58,7 @@ The output of this command is supposed to be machine-readable.
Usage: "Checks (online) for known Geth security vulnerabilities", Usage: "Checks (online) for known Geth security vulnerabilities",
ArgsUsage: "<versionstring (optional)>", ArgsUsage: "<versionstring (optional)>",
Description: ` Description: `
The version-check command fetches vulnerability-information from https://geth.ethereum.org/docs/vulnerabilities/vulnerabilities.json, The version-check command fetches vulnerability-information from https://geth.ethereum.org/docs/vulnerabilities/vulnerabilities.json,
and displays information about any security vulnerabilities that affect the currently executing version. and displays information about any security vulnerabilities that affect the currently executing version.
`, `,
} }
@ -74,6 +75,7 @@ func printVersion(ctx *cli.Context) error {
fmt.Println(strings.Title(clientIdentifier)) fmt.Println(strings.Title(clientIdentifier))
fmt.Println("Version:", params.VersionWithMeta) fmt.Println("Version:", params.VersionWithMeta)
fmt.Println("Firehose Tracer Protocol Version: fh", tracers.FirehoseProtocolVersion)
if git.Commit != "" { if git.Commit != "" {
fmt.Println("Git Commit:", git.Commit) fmt.Println("Git Commit:", git.Commit)
} }

View file

@ -24,6 +24,7 @@ import (
"github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/eth/tracers/directory" "github.com/ethereum/go-ethereum/eth/tracers/directory"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rlp"
pbeth "github.com/streamingfast/firehose-ethereum/types/pb/sf/ethereum/type/v2" pbeth "github.com/streamingfast/firehose-ethereum/types/pb/sf/ethereum/type/v2"
"golang.org/x/exp/maps" "golang.org/x/exp/maps"
@ -74,10 +75,11 @@ type Firehose struct {
latestCallStartSuicided bool latestCallStartSuicided bool
} }
const FirehoseProtocolVersion = "3.0"
func NewFirehoseLogger() *Firehose { func NewFirehoseLogger() *Firehose {
// FIXME: Where should we put our actual INIT line? // FIXME: Where should we put our actual INIT line?
// FIXME: Pickup version from go-ethereum (PR comment) printToFirehose("INIT", FirehoseProtocolVersion, "geth", params.Version)
printToFirehose("INIT", "2.3", "geth", "1.12.0")
return &Firehose{ return &Firehose{
// Global state // Global state
@ -460,12 +462,6 @@ func (f *Firehose) callStart(source string, callType pbeth.CallType, from common
input = nil input = nil
} }
v := firehoseBigIntFromNative(value)
if callType == pbeth.CallType_DELEGATE {
// If it's a delegate call, the there should be a call in the stack and value should be parent's value
v = f.callStack.Peek().Value
}
call := &pbeth.Call{ call := &pbeth.Call{
// Known Firehose issue: Ref 042a2ff03fd623f151d7726314b8aad6 (see below) // Known Firehose issue: Ref 042a2ff03fd623f151d7726314b8aad6 (see below)
// //
@ -477,7 +473,7 @@ func (f *Firehose) callStart(source string, callType pbeth.CallType, from common
Address: to.Bytes(), Address: to.Bytes(),
// We need to clone `input` received by the tracer as it's re-used within Geth! // We need to clone `input` received by the tracer as it's re-used within Geth!
Input: bytes.Clone(input), Input: bytes.Clone(input),
Value: v, Value: firehoseBigIntFromNative(value),
GasLimit: gas, GasLimit: gas,
} }