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
af34749a
Commit
af34749a
authored
10 years ago
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ethtrie => trie
parent
af8f5f0b
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
22 additions
and
22 deletions
+22
-22
block.go
chain/block.go
+4
-4
derive_sha.go
chain/derive_sha.go
+2
-2
state.go
state/state.go
+4
-4
state_object.go
state/state_object.go
+6
-6
encoding.go
trie/encoding.go
+1
-1
encoding_test.go
trie/encoding_test.go
+1
-1
iterator.go
trie/iterator.go
+1
-1
slice.go
trie/slice.go
+1
-1
trie.go
trie/trie.go
+1
-1
trie_test.go
trie/trie_test.go
+1
-1
No files found.
chain/block.go
View file @
af34749a
...
...
@@ -8,9 +8,9 @@ import (
"time"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethtrie"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/trie"
)
type
BlockInfo
struct
{
...
...
@@ -137,7 +137,7 @@ func CreateBlock(root interface{},
}
block
.
SetUncles
([]
*
Block
{})
block
.
state
=
state
.
New
(
eth
trie
.
New
(
ethutil
.
Config
.
Db
,
root
))
block
.
state
=
state
.
New
(
trie
.
New
(
ethutil
.
Config
.
Db
,
root
))
return
block
}
...
...
@@ -294,7 +294,7 @@ func (self *Block) setHeader(header *ethutil.Value) {
self
.
PrevHash
=
header
.
Get
(
0
)
.
Bytes
()
self
.
UncleSha
=
header
.
Get
(
1
)
.
Bytes
()
self
.
Coinbase
=
header
.
Get
(
2
)
.
Bytes
()
self
.
state
=
state
.
New
(
eth
trie
.
New
(
ethutil
.
Config
.
Db
,
header
.
Get
(
3
)
.
Val
))
self
.
state
=
state
.
New
(
trie
.
New
(
ethutil
.
Config
.
Db
,
header
.
Get
(
3
)
.
Val
))
self
.
TxSha
=
header
.
Get
(
4
)
.
Bytes
()
self
.
ReceiptSha
=
header
.
Get
(
5
)
.
Bytes
()
self
.
LogsBloom
=
header
.
Get
(
6
)
.
Bytes
()
...
...
@@ -315,7 +315,7 @@ func NewUncleBlockFromValue(header *ethutil.Value) *Block {
return
block
}
func
(
block
*
Block
)
Trie
()
*
eth
trie
.
Trie
{
func
(
block
*
Block
)
Trie
()
*
trie
.
Trie
{
return
block
.
state
.
Trie
}
...
...
This diff is collapsed.
Click to expand it.
chain/derive_sha.go
View file @
af34749a
package
chain
import
(
"github.com/ethereum/go-ethereum/ethtrie"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/trie"
)
type
DerivableList
interface
{
...
...
@@ -11,7 +11,7 @@ type DerivableList interface {
}
func
DeriveSha
(
list
DerivableList
)
[]
byte
{
trie
:=
eth
trie
.
New
(
ethutil
.
Config
.
Db
,
""
)
trie
:=
trie
.
New
(
ethutil
.
Config
.
Db
,
""
)
for
i
:=
0
;
i
<
list
.
Len
();
i
++
{
trie
.
Update
(
string
(
ethutil
.
NewValue
(
i
)
.
Encode
()),
string
(
list
.
GetRlp
(
i
)))
}
...
...
This diff is collapsed.
Click to expand it.
state/state.go
View file @
af34749a
...
...
@@ -3,9 +3,9 @@ package state
import
(
"math/big"
"github.com/ethereum/go-ethereum/ethtrie"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/trie"
)
var
statelogger
=
logger
.
NewLogger
(
"STATE"
)
...
...
@@ -17,7 +17,7 @@ var statelogger = logger.NewLogger("STATE")
// * Accounts
type
State
struct
{
// The trie for this structure
Trie
*
eth
trie
.
Trie
Trie
*
trie
.
Trie
stateObjects
map
[
string
]
*
StateObject
...
...
@@ -29,7 +29,7 @@ type State struct {
}
// Create a new state from a given trie
func
New
(
trie
*
eth
trie
.
Trie
)
*
State
{
func
New
(
trie
*
trie
.
Trie
)
*
State
{
return
&
State
{
Trie
:
trie
,
stateObjects
:
make
(
map
[
string
]
*
StateObject
),
manifest
:
NewManifest
(),
refund
:
make
(
map
[
string
]
*
big
.
Int
)}
}
...
...
@@ -300,7 +300,7 @@ func (self *State) Update() {
// FIXME trie delete is broken
if
deleted
{
valid
,
t2
:=
eth
trie
.
ParanoiaCheck
(
self
.
Trie
)
valid
,
t2
:=
trie
.
ParanoiaCheck
(
self
.
Trie
)
if
!
valid
{
statelogger
.
Infof
(
"Warn: PARANOIA: Different state root during copy %x vs %x
\n
"
,
self
.
Trie
.
Root
,
t2
.
Root
)
...
...
This diff is collapsed.
Click to expand it.
state/state_object.go
View file @
af34749a
...
...
@@ -5,8 +5,8 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethtrie"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/trie"
)
type
Code
[]
byte
...
...
@@ -62,7 +62,7 @@ func NewStateObject(addr []byte) *StateObject {
address
:=
ethutil
.
Address
(
addr
)
object
:=
&
StateObject
{
address
:
address
,
balance
:
new
(
big
.
Int
),
gasPool
:
new
(
big
.
Int
)}
object
.
State
=
New
(
eth
trie
.
New
(
ethutil
.
Config
.
Db
,
""
))
object
.
State
=
New
(
trie
.
New
(
ethutil
.
Config
.
Db
,
""
))
object
.
storage
=
make
(
Storage
)
object
.
gasPool
=
new
(
big
.
Int
)
...
...
@@ -72,7 +72,7 @@ func NewStateObject(addr []byte) *StateObject {
func
NewContract
(
address
[]
byte
,
balance
*
big
.
Int
,
root
[]
byte
)
*
StateObject
{
contract
:=
NewStateObject
(
address
)
contract
.
balance
=
balance
contract
.
State
=
New
(
eth
trie
.
New
(
ethutil
.
Config
.
Db
,
string
(
root
)))
contract
.
State
=
New
(
trie
.
New
(
ethutil
.
Config
.
Db
,
string
(
root
)))
return
contract
}
...
...
@@ -129,7 +129,7 @@ func (self *StateObject) SetState(k []byte, value *ethutil.Value) {
}
// Iterate over each storage address and yield callback
func
(
self
*
StateObject
)
EachStorage
(
cb
eth
trie
.
EachCallback
)
{
func
(
self
*
StateObject
)
EachStorage
(
cb
trie
.
EachCallback
)
{
// First loop over the uncommit/cached values in storage
for
key
,
value
:=
range
self
.
storage
{
// XXX Most iterators Fns as it stands require encoded values
...
...
@@ -158,7 +158,7 @@ func (self *StateObject) Sync() {
self
.
SetAddr
([]
byte
(
key
),
value
)
}
valid
,
t2
:=
eth
trie
.
ParanoiaCheck
(
self
.
State
.
Trie
)
valid
,
t2
:=
trie
.
ParanoiaCheck
(
self
.
State
.
Trie
)
if
!
valid
{
statelogger
.
Infof
(
"Warn: PARANOIA: Different state storage root during copy %x vs %x
\n
"
,
self
.
State
.
Trie
.
Root
,
t2
.
Root
)
...
...
@@ -321,7 +321,7 @@ func (c *StateObject) RlpDecode(data []byte) {
c
.
Nonce
=
decoder
.
Get
(
0
)
.
Uint
()
c
.
balance
=
decoder
.
Get
(
1
)
.
BigInt
()
c
.
State
=
New
(
eth
trie
.
New
(
ethutil
.
Config
.
Db
,
decoder
.
Get
(
2
)
.
Interface
()))
c
.
State
=
New
(
trie
.
New
(
ethutil
.
Config
.
Db
,
decoder
.
Get
(
2
)
.
Interface
()))
c
.
storage
=
make
(
map
[
string
]
*
ethutil
.
Value
)
c
.
gasPool
=
new
(
big
.
Int
)
...
...
This diff is collapsed.
Click to expand it.
eth
trie/encoding.go
→
trie/encoding.go
View file @
af34749a
package
eth
trie
package
trie
import
(
"bytes"
...
...
This diff is collapsed.
Click to expand it.
eth
trie/encoding_test.go
→
trie/encoding_test.go
View file @
af34749a
package
eth
trie
package
trie
import
(
"bytes"
...
...
This diff is collapsed.
Click to expand it.
eth
trie/iterator.go
→
trie/iterator.go
View file @
af34749a
package
eth
trie
package
trie
import
(
"bytes"
...
...
This diff is collapsed.
Click to expand it.
eth
trie/slice.go
→
trie/slice.go
View file @
af34749a
package
eth
trie
package
trie
import
(
"bytes"
...
...
This diff is collapsed.
Click to expand it.
eth
trie/trie.go
→
trie/trie.go
View file @
af34749a
package
eth
trie
package
trie
import
(
"bytes"
...
...
This diff is collapsed.
Click to expand it.
eth
trie/trie_test.go
→
trie/trie_test.go
View file @
af34749a
package
eth
trie
package
trie
import
(
"bytes"
...
...
This diff is collapsed.
Click to expand it.
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