Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
05acc272
Unverified
Commit
05acc272
authored
Nov 16, 2021
by
Sina Mahmoodi
Committed by
GitHub
Nov 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth/tracers: make native 4byte default, remove js version (#23916)
parent
b0b708bf
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
95 deletions
+2
-95
4byte_tracer.js
eth/tracers/js/internal/tracers/4byte_tracer.js
+0
-70
assets.go
eth/tracers/js/internal/tracers/assets.go
+0
-23
4byte.go
eth/tracers/native/4byte.go
+2
-2
No files found.
eth/tracers/js/internal/tracers/4byte_tracer.js
deleted
100644 → 0
View file @
b0b708bf
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// 4byteTracer searches for 4byte-identifiers, and collects them for post-processing.
// It collects the methods identifiers along with the size of the supplied data, so
// a reversed signature can be matched against the size of the data.
//
// Example:
// > debug.traceTransaction( "0x214e597e35da083692f5386141e69f47e973b2c56e7a8073b1ea08fd7571e9de", {tracer: "4byteTracer"})
// {
// 0x27dc297e-128: 1,
// 0x38cc4831-0: 2,
// 0x524f3889-96: 1,
// 0xadf59f99-288: 1,
// 0xc281d19e-0: 1
// }
{
// ids aggregates the 4byte ids found.
ids
:
{},
// store save the given indentifier and datasize.
store
:
function
(
id
,
size
){
var
key
=
""
+
toHex
(
id
)
+
"-"
+
size
;
this
.
ids
[
key
]
=
this
.
ids
[
key
]
+
1
||
1
;
},
enter
:
function
(
frame
,
log
)
{
// Skip any pre-compile invocations, those are just fancy opcodes
if
(
isPrecompiled
(
frame
.
getTo
()))
{
return
;
}
var
type
=
frame
.
getType
()
if
(
type
!==
"CALL"
&&
type
!==
"STATICCALL"
&&
type
!==
"DELEGATECALL"
&&
type
!==
"CALLCODE"
){
return
;
}
var
input
=
frame
.
getInput
()
if
(
input
.
length
>=
4
)
{
this
.
store
(
slice
(
input
,
0
,
4
),
input
.
length
-
4
);
}
},
exit
:
function
(
frameResult
)
{},
// fault is invoked when the actual execution of an opcode fails.
fault
:
function
(
log
,
db
)
{},
// result is invoked when all the opcodes have been iterated over and returns
// the final result of the tracing.
result
:
function
(
ctx
)
{
// Save the outer calldata also
if
(
ctx
.
input
.
length
>=
4
)
{
this
.
store
(
slice
(
ctx
.
input
,
0
,
4
),
ctx
.
input
.
length
-
4
)
}
return
this
.
ids
;
},
}
eth/tracers/js/internal/tracers/assets.go
View file @
05acc272
This diff is collapsed.
Click to expand it.
eth/tracers/native/4byte.go
View file @
05acc272
...
...
@@ -29,7 +29,7 @@ import (
)
func
init
()
{
register
(
"4byte"
,
newFourByteTracer
)
register
(
"4byte
Tracer
"
,
newFourByteTracer
)
}
// fourByteTracer searches for 4byte-identifiers, and collects them for post-processing.
...
...
@@ -37,7 +37,7 @@ func init() {
// a reversed signature can be matched against the size of the data.
//
// Example:
// > debug.traceTransaction( "0x214e597e35da083692f5386141e69f47e973b2c56e7a8073b1ea08fd7571e9de", {tracer: "4byte"})
// > debug.traceTransaction( "0x214e597e35da083692f5386141e69f47e973b2c56e7a8073b1ea08fd7571e9de", {tracer: "4byte
Tracer
"})
// {
// 0x27dc297e-128: 1,
// 0x38cc4831-0: 2,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment