Skip to content

Commit

Permalink
feat: data length field
Browse files Browse the repository at this point in the history
Adding a note in the transaction of how big the input data is
  • Loading branch information
praetoriansentry committed Aug 20, 2022
1 parent 5b3b453 commit a46ce7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.org
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,8 @@ we'll startup geth.

#+begin_src shell
# Geth
./build/bin/geth --dev --dev.period 2 --http --http.addr localhost --http.port 8545 --http.api eth,web3,personal,net --verbosity 5
./build/bin/geth --dev --dev.period 2 --http --http.addr localhost --http.port 8545 --http.api eth,web3,personal,net --verbosity 5 --rpc.gascap 18446744073709551615 --rpc.txfeecap 0 --miner.gaslimit 10 --miner.gasprice 1 --gpo.blocks 1 --gpo.percentile 1 --gpo.maxprice 10 --gpo.ignoreprice 2


# v3
go run cmd/borv3/main.go server --dev \
Expand Down
4 changes: 2 additions & 2 deletions metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,7 @@ func GetSimpleTxFields(tx rpctypes.PolyTransaction, chainID, baseFee *big.Int) [
fields = append(fields, fmt.Sprintf("Tx Hash: %s", tx.Hash()))

txMethod := "Transfer"
if tx.To().String() == "" {
// TODO DOUBLE CHECK THIS!!!!!!!!!!!!!!
if tx.To().String() == "0x0000000000000000000000000000000000000000" {
// Contract deployment
txMethod = "Contract Deployment"
} else if len(tx.Data()) > 4 {
Expand All @@ -243,6 +242,7 @@ func GetSimpleTxFields(tx rpctypes.PolyTransaction, chainID, baseFee *big.Int) [
fields = append(fields, fmt.Sprintf("Gas: %d", tx.Gas()))
fields = append(fields, fmt.Sprintf("Gas Price: %s", tx.GasPrice()))
fields = append(fields, fmt.Sprintf("Nonce: %d", tx.Nonce()))
fields = append(fields, fmt.Sprintf("Data Len: %d", len(tx.Data())))
fields = append(fields, fmt.Sprintf("Data: %s", hex.EncodeToString(tx.Data())))

return fields
Expand Down

0 comments on commit a46ce7c

Please sign in to comment.