Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
exchain
nebula
Commits
ba0a85a5
Commit
ba0a85a5
authored
Sep 22, 2021
by
George Hotz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builds but segfaults
parent
60a349f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
database.go
minigeth/core/state/database.go
+7
-7
statedb.go
minigeth/core/state/statedb.go
+6
-1
No files found.
minigeth/core/state/database.go
View file @
ba0a85a5
...
@@ -43,7 +43,7 @@ func (db *Database) ContractCodeSize(addrHash common.Hash, codeHash common.Hash)
...
@@ -43,7 +43,7 @@ func (db *Database) ContractCodeSize(addrHash common.Hash, codeHash common.Hash)
// OpenStorageTrie opens the storage trie of an account.
// OpenStorageTrie opens the storage trie of an account.
func
(
db
*
Database
)
OpenStorageTrie
(
addrHash
,
root
common
.
Hash
)
(
Trie
,
error
)
{
func
(
db
*
Database
)
OpenStorageTrie
(
addrHash
,
root
common
.
Hash
)
(
Trie
,
error
)
{
return
s
impleTrie
{},
nil
return
S
impleTrie
{},
nil
}
}
type
LeafCallback
func
(
paths
[][]
byte
,
hexpath
[]
byte
,
leaf
[]
byte
,
parent
common
.
Hash
)
error
type
LeafCallback
func
(
paths
[][]
byte
,
hexpath
[]
byte
,
leaf
[]
byte
,
parent
common
.
Hash
)
error
...
@@ -73,28 +73,28 @@ type Trie interface {
...
@@ -73,28 +73,28 @@ type Trie interface {
Commit
(
onleaf
LeafCallback
)
(
common
.
Hash
,
error
)
Commit
(
onleaf
LeafCallback
)
(
common
.
Hash
,
error
)
}
}
type
s
impleTrie
struct
{
type
S
impleTrie
struct
{
BlockNumber
*
big
.
Int
BlockNumber
*
big
.
Int
StateRoot
common
.
Hash
StateRoot
common
.
Hash
}
}
func
(
trie
s
impleTrie
)
Commit
(
onleaf
LeafCallback
)
(
common
.
Hash
,
error
)
{
func
(
trie
S
impleTrie
)
Commit
(
onleaf
LeafCallback
)
(
common
.
Hash
,
error
)
{
return
trie
.
StateRoot
,
nil
return
trie
.
StateRoot
,
nil
}
}
func
(
trie
s
impleTrie
)
Hash
()
common
.
Hash
{
func
(
trie
S
impleTrie
)
Hash
()
common
.
Hash
{
return
trie
.
StateRoot
return
trie
.
StateRoot
}
}
func
(
trie
s
impleTrie
)
TryUpdate
(
key
,
value
[]
byte
)
error
{
func
(
trie
S
impleTrie
)
TryUpdate
(
key
,
value
[]
byte
)
error
{
return
nil
return
nil
}
}
func
(
trie
s
impleTrie
)
TryDelete
(
key
[]
byte
)
error
{
func
(
trie
S
impleTrie
)
TryDelete
(
key
[]
byte
)
error
{
return
nil
return
nil
}
}
func
(
trie
s
impleTrie
)
TryGet
(
key
[]
byte
)
([]
byte
,
error
)
{
func
(
trie
S
impleTrie
)
TryGet
(
key
[]
byte
)
([]
byte
,
error
)
{
address
:=
common
.
BytesToAddress
(
key
)
address
:=
common
.
BytesToAddress
(
key
)
addrHash
:=
crypto
.
Keccak256Hash
(
address
[
:
])
addrHash
:=
crypto
.
Keccak256Hash
(
address
[
:
])
unhashMap
[
addrHash
]
=
address
unhashMap
[
addrHash
]
=
address
...
...
minigeth/core/state/statedb.go
View file @
ba0a85a5
...
@@ -18,6 +18,11 @@ var (
...
@@ -18,6 +18,11 @@ var (
emptyRoot
=
common
.
HexToHash
(
"56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
)
emptyRoot
=
common
.
HexToHash
(
"56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
)
)
)
type
revision
struct
{
id
int
journalIndex
int
}
type
StateDB
struct
{
type
StateDB
struct
{
db
Database
db
Database
prefetcher
*
triePrefetcher
prefetcher
*
triePrefetcher
...
@@ -81,7 +86,7 @@ func NewStateDB(header types.Header) *StateDB {
...
@@ -81,7 +86,7 @@ func NewStateDB(header types.Header) *StateDB {
stateObjectsDirty
:
make
(
map
[
common
.
Address
]
struct
{}),
stateObjectsDirty
:
make
(
map
[
common
.
Address
]
struct
{}),
stateRoot
:
header
.
Root
,
stateRoot
:
header
.
Root
,
db
:
Database
{
BlockNumber
:
header
.
Number
,
StateRoot
:
header
.
Root
},
db
:
Database
{
BlockNumber
:
header
.
Number
,
StateRoot
:
header
.
Root
},
trie
:
Trie
{
BlockNumber
:
header
.
Number
,
StateRoot
:
header
.
Root
},
trie
:
Simple
Trie
{
BlockNumber
:
header
.
Number
,
StateRoot
:
header
.
Root
},
accessList
:
newAccessList
(),
accessList
:
newAccessList
(),
logs
:
make
(
map
[
common
.
Hash
][]
*
types
.
Log
),
logs
:
make
(
map
[
common
.
Hash
][]
*
types
.
Log
),
}
}
...
...
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