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
47293ac7
Commit
47293ac7
authored
Sep 26, 2021
by
George Hotz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testing many blocks
parent
00f02645
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
5 deletions
+7
-5
state_processor.go
minigeth/core/state_processor.go
+3
-1
main.go
minigeth/main.go
+1
-1
embedded_mips.go
minigeth/oracle/embedded_mips.go
+2
-1
database.go
minigeth/trie/database.go
+1
-2
No files found.
minigeth/core/state_processor.go
View file @
47293ac7
...
@@ -19,6 +19,7 @@ package core
...
@@ -19,6 +19,7 @@ package core
import
(
import
(
"fmt"
"fmt"
"math/big"
"math/big"
"os"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/consensus"
"github.com/ethereum/go-ethereum/consensus"
...
@@ -74,7 +75,8 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
...
@@ -74,7 +75,8 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
vmenv
:=
vm
.
NewEVM
(
blockContext
,
vm
.
TxContext
{},
statedb
,
p
.
config
,
cfg
)
vmenv
:=
vm
.
NewEVM
(
blockContext
,
vm
.
TxContext
{},
statedb
,
p
.
config
,
cfg
)
// Iterate over and process the individual transactions
// Iterate over and process the individual transactions
for
i
,
tx
:=
range
block
.
Transactions
()
{
for
i
,
tx
:=
range
block
.
Transactions
()
{
fmt
.
Println
(
i
,
tx
.
Hash
())
//fmt.Println(i, tx.Hash())
os
.
Stdout
.
WriteString
(
"."
)
msg
,
err
:=
tx
.
AsMessage
(
types
.
MakeSigner
(
p
.
config
,
header
.
Number
),
header
.
BaseFee
)
msg
,
err
:=
tx
.
AsMessage
(
types
.
MakeSigner
(
p
.
config
,
header
.
Number
),
header
.
BaseFee
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
nil
,
0
,
fmt
.
Errorf
(
"could not apply tx %d [%v]: %w"
,
i
,
tx
.
Hash
()
.
Hex
(),
err
)
return
nil
,
nil
,
0
,
fmt
.
Errorf
(
"could not apply tx %d [%v]: %w"
,
i
,
tx
.
Hash
()
.
Hex
(),
err
)
...
...
minigeth/main.go
View file @
47293ac7
...
@@ -66,7 +66,7 @@ func main() {
...
@@ -66,7 +66,7 @@ func main() {
statedb
,
_
:=
state
.
New
(
parent
.
Root
,
database
,
nil
)
statedb
,
_
:=
state
.
New
(
parent
.
Root
,
database
,
nil
)
vmconfig
:=
vm
.
Config
{}
vmconfig
:=
vm
.
Config
{}
processor
:=
core
.
NewStateProcessor
(
params
.
MainnetChainConfig
,
bc
,
bc
.
Engine
())
processor
:=
core
.
NewStateProcessor
(
params
.
MainnetChainConfig
,
bc
,
bc
.
Engine
())
fmt
.
Println
(
"
made state processor"
)
fmt
.
Println
(
"
processing state:"
,
parent
.
Number
,
"->"
,
newheader
.
Number
)
// read txs
// read txs
//traverseStackTrie(newheader.TxHash)
//traverseStackTrie(newheader.TxHash)
...
...
minigeth/oracle/embedded_mips.go
View file @
47293ac7
...
@@ -15,7 +15,8 @@ import (
...
@@ -15,7 +15,8 @@ import (
)
)
var
preimages
=
make
(
map
[
common
.
Hash
][]
byte
)
var
preimages
=
make
(
map
[
common
.
Hash
][]
byte
)
var
inputs
[
7
]
common
.
Hash
// only 6 here
var
inputs
[
6
]
common
.
Hash
var
inputsLoaded
bool
=
false
var
inputsLoaded
bool
=
false
func
byteAt
(
addr
uint64
,
length
int
)
[]
byte
{
func
byteAt
(
addr
uint64
,
length
int
)
[]
byte
{
...
...
minigeth/trie/database.go
View file @
47293ac7
...
@@ -2,7 +2,6 @@ package trie
...
@@ -2,7 +2,6 @@ package trie
import
(
import
(
"bytes"
"bytes"
"fmt"
"io"
"io"
"math/big"
"math/big"
"sync"
"sync"
...
@@ -36,7 +35,7 @@ type Database struct {
...
@@ -36,7 +35,7 @@ type Database struct {
func
NewDatabase
(
header
types
.
Header
)
Database
{
func
NewDatabase
(
header
types
.
Header
)
Database
{
triedb
:=
Database
{
BlockNumber
:
header
.
Number
,
Root
:
header
.
Root
}
triedb
:=
Database
{
BlockNumber
:
header
.
Number
,
Root
:
header
.
Root
}
//triedb.preimages = make(map[common.Hash][]byte)
//triedb.preimages = make(map[common.Hash][]byte)
fmt
.
Println
(
"init database"
)
//
fmt.Println("init database")
oracle
.
PrefetchAccount
(
header
.
Number
,
common
.
Address
{},
nil
)
oracle
.
PrefetchAccount
(
header
.
Number
,
common
.
Address
{},
nil
)
//panic("preseed")
//panic("preseed")
...
...
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