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
5b46f1d1
Unverified
Commit
5b46f1d1
authored
May 10, 2022
by
Sina Mahmoodi
Committed by
GitHub
May 10, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
internal: drop TestSignCliqueBlock (#24837)
parent
7caa2d81
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
46 deletions
+0
-46
api.go
internal/ethapi/api.go
+0
-40
web3ext.go
internal/web3ext/web3ext.go
+0
-6
No files found.
internal/ethapi/api.go
View file @
5b46f1d1
...
...
@@ -32,7 +32,6 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/consensus/clique"
"github.com/ethereum/go-ethereum/consensus/ethash"
"github.com/ethereum/go-ethereum/consensus/misc"
"github.com/ethereum/go-ethereum/core"
...
...
@@ -1875,45 +1874,6 @@ func (api *PublicDebugAPI) GetBlockRlp(ctx context.Context, number uint64) (hexu
return
rlp
.
EncodeToBytes
(
block
)
}
// TestSignCliqueBlock fetches the given block number, and attempts to sign it as a clique header with the
// given address, returning the address of the recovered signature
//
// This is a temporary method to debug the externalsigner integration,
// TODO: Remove this method when the integration is mature
func
(
api
*
PublicDebugAPI
)
TestSignCliqueBlock
(
ctx
context
.
Context
,
address
common
.
Address
,
number
uint64
)
(
common
.
Address
,
error
)
{
block
,
_
:=
api
.
b
.
BlockByNumber
(
ctx
,
rpc
.
BlockNumber
(
number
))
if
block
==
nil
{
return
common
.
Address
{},
fmt
.
Errorf
(
"block #%d not found"
,
number
)
}
header
:=
block
.
Header
()
header
.
Extra
=
make
([]
byte
,
32
+
65
)
encoded
:=
clique
.
CliqueRLP
(
header
)
// Look up the wallet containing the requested signer
account
:=
accounts
.
Account
{
Address
:
address
}
wallet
,
err
:=
api
.
b
.
AccountManager
()
.
Find
(
account
)
if
err
!=
nil
{
return
common
.
Address
{},
err
}
signature
,
err
:=
wallet
.
SignData
(
account
,
accounts
.
MimetypeClique
,
encoded
)
if
err
!=
nil
{
return
common
.
Address
{},
err
}
sealHash
:=
clique
.
SealHash
(
header
)
.
Bytes
()
log
.
Info
(
"test signing of clique block"
,
"Sealhash"
,
fmt
.
Sprintf
(
"%x"
,
sealHash
),
"signature"
,
fmt
.
Sprintf
(
"%x"
,
signature
))
pubkey
,
err
:=
crypto
.
Ecrecover
(
sealHash
,
signature
)
if
err
!=
nil
{
return
common
.
Address
{},
err
}
var
signer
common
.
Address
copy
(
signer
[
:
],
crypto
.
Keccak256
(
pubkey
[
1
:
])[
12
:
])
return
signer
,
nil
}
// PrintBlock retrieves a block and returns its pretty printed form.
func
(
api
*
PublicDebugAPI
)
PrintBlock
(
ctx
context
.
Context
,
number
uint64
)
(
string
,
error
)
{
block
,
_
:=
api
.
b
.
BlockByNumber
(
ctx
,
rpc
.
BlockNumber
(
number
))
...
...
internal/web3ext/web3ext.go
View file @
5b46f1d1
...
...
@@ -233,12 +233,6 @@ web3._extend({
call: 'debug_getBlockRlp',
params: 1
}),
new web3._extend.Method({
name: 'testSignCliqueBlock',
call: 'debug_testSignCliqueBlock',
params: 2,
inputFormatter: [web3._extend.formatters.inputAddressFormatter, null],
}),
new web3._extend.Method({
name: 'setHead',
call: 'debug_setHead',
...
...
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