Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
ecaef53
Feat: Parallel Transaction Execution Implementation
sunny2022da Jul 29, 2024
247f63c
Fix: fix incorrectly set origin storage.
DavidWZ3 Jul 3, 2024
dedf04e
Feat: TxDAG: support TxDAG
galaio Jul 5, 2024
0f9be14
fix several UT with racing issues (#5)
DavidWZ3 Jul 16, 2024
e2517b3
TxDAG: support PEVM static dispatch; (#6)
galaio Jul 18, 2024
d3edc53
fix UT test and contention issue (#7)
DavidWZ3 Jul 18, 2024
74e2c96
Fix: dead lock issue
sunny2022da Jul 18, 2024
1e09e32
Fix: avoid update the stateObjects at conflict check phase
sunny2022da Jul 18, 2024
2c9e42c
TxDAG: support TxDAG transfer, it can be used in QA performance testi…
galaio Jul 24, 2024
732090a
txdag: support write & read TxDAG from file; (#9)
galaio Jul 24, 2024
ada5f62
FIX: redundancy execution and incorrect merge of dirty object (#12)
DavidWZ3 Jul 29, 2024
6b51dcc
pevm: support delay gas fee calculation & Uts; (#11)
galaio Jul 29, 2024
23d66cc
FIX: issue in fixUpOriginAndResetPendingStorage (#14)
DavidWZ3 Jul 29, 2024
4f213c5
Fix: racying issue in fixUpOriginAndResetPendingStorage
sunny2022da Jul 30, 2024
a48f502
txdag: remove legacy TxDAG transfer logic; (#16)
galaio Jul 30, 2024
947370f
txdag: opt txdag logic & clean todos; (#17)
galaio Jul 31, 2024
5963131
refine lock and fix racying issue (#18)
DavidWZ3 Aug 2, 2024
ea8d9ad
txdag: opt TxDAG rwset collecting & generating; (#19)
galaio Aug 2, 2024
eaf7405
contention issue fix (#21)
DavidWZ3 Aug 5, 2024
92b02c9
txdag: support multi flags, and supported in pevm; (#22)
galaio Aug 6, 2024
bfff8f8
pevm: opt slot trigger mechanism; (#24)
galaio Aug 6, 2024
ec799b0
fix addBalance for delayGasFee (#25)
DavidWZ3 Aug 7, 2024
4c41ce4
txdag: opt read txdag file and validation logic; (#26)
galaio Aug 8, 2024
879bf45
pevm: opt read large txdag logic and add conflict metrics; (#29)
galaio Aug 13, 2024
f111c50
feat: avoid parallel process for block with few txs
sunny2022da Aug 7, 2024
6a205be
feat: avoid parallel process for block with few txs
sunny2022da Aug 7, 2024
2f99b82
fix: avoid rewrite readsCache in slotDB
sunny2022da Aug 8, 2024
6117f5e
Fix: incorrect GetState of obsoleted data caused by createObject
sunny2022da Aug 8, 2024
828901f
fix: DAG disable access unconfirmedDB
sunny2022da Aug 11, 2024
e774f15
do not check special addr 0x1 for destruct
sunny2022da Aug 11, 2024
fcc558c
fix log issue
sunny2022da Aug 12, 2024
f38a91e
fix: false report of conflict
sunny2022da Aug 13, 2024
3b0cf58
txDAG transfer (#28)
andyzhang2023 Aug 13, 2024
6c0427b
txdag: using pending writes to accelerate txdag generation, add more …
galaio Aug 13, 2024
f614341
feat: code cleanup (#23)
DavidWZ3 Aug 13, 2024
4b29585
recover test case
sunny2022da Aug 14, 2024
ecd5463
fix ut of txDAG (#32)
andyzhang2023 Aug 14, 2024
a6583c8
txdag: support reset txdag reader when SetHead; (#31)
galaio Aug 14, 2024
0a1c2d6
txdag: fix system tx finalise issue; (#33)
galaio Aug 14, 2024
79fdce7
fix: refine the log level of PEVM (#34)
DavidWZ3 Aug 14, 2024
52ce0e9
mvstates: fix async dep gen deadlock issue & opt mining txdag generat…
galaio Aug 15, 2024
737ed16
fix parallel Num (#36)
DavidWZ3 Aug 15, 2024
febc88e
fix: remove unnecessary locks for stateobjects (#37)
DavidWZ3 Aug 15, 2024
34012e1
mvstates: opt async dep generation; (#38)
galaio Aug 16, 2024
1a40629
mvstates: fix oom issue when mining is enabled; (#40)
galaio Aug 16, 2024
f5cc9ca
reduce overhead of slotDB initialize (#39)
DavidWZ3 Aug 19, 2024
fb8203e
mvstates: fix oom issue when mining is enabled;
galaio Aug 16, 2024
9c9bdca
Fix: contention issue of Trie for PEVM (#41)
DavidWZ3 Aug 20, 2024
c96af03
worker: fix TxDAG generation issues when mining block; (#43)
galaio Aug 20, 2024
87987cc
pevm-opt: Enable parallel kv conflict check
sunny2022da Aug 21, 2024
061cd9b
pevm-opt: Add conflict check cache
sunny2022da Aug 21, 2024
2768aea
PEVM-fix: avoid checkout old tx in stage2 conflict check
sunny2022da Aug 22, 2024
8571571
pevm: add a side slot to trigger next tx advance;
galaio Aug 23, 2024
fb2630c
pevm: fix some bad check & support to fallback to serial processor;
galaio Aug 27, 2024
c97b6c1
pevm: fix some bad check & support to fallback to serial processor;
galaio Aug 27, 2024
94d3658
async the merge phase
sunny2022da Aug 28, 2024
72b27f4
disable parallel if parallel.num is low
sunny2022da Aug 30, 2024
d300ab8
do CompareAndSwap only necessary
sunny2022da Aug 30, 2024
4d6273f
remove uncessary memory overhead and reuse SyncPool
sunny2022da Sep 2, 2024
8ea1140
fix putSyncPool and GC issue
sunny2022da Sep 3, 2024
3c5eda5
parallelDBManager global
sunny2022da Sep 4, 2024
fc50e31
pevm-opt: lock free localstateObjects (#167)
sunny2022da Sep 9, 2024
db146bc
PEVM-fix: assesslist append and optimize mergeSlotDB (#168)
sunny2022da Sep 10, 2024
d03c218
PEVM-opt: parallel Txs Prepare (#176)
sunny2022da Sep 12, 2024
f8f5dc4
fix issue after rebase
sunny2022da Sep 25, 2024
8c429ad
fix code hash issue after rebase
sunny2022da Sep 26, 2024
c8b6a41
log
sunny2022da Sep 26, 2024
e66ad25
fix createObject prev
sunny2022da Sep 27, 2024
ba207bc
fix: test case issue after rebase
sunny2022da Sep 29, 2024
54dd5ad
log setcode
sunny2022da Sep 29, 2024
536d5d9
fix getcode with log
sunny2022da Sep 30, 2024
1ffacc6
fix trie prefetch issue after rebase
sunny2022da Oct 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/evm/blockrunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func blockTestCmd(ctx *cli.Context) error {
fmt.Println(string(state.Dump(nil)))
}
}
}); err != nil {
}, "", true); err != nil {
return fmt.Errorf("test %v: %w", name, err)
}
}
Expand Down
5 changes: 5 additions & 0 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ var (
utils.RollupComputePendingBlock,
utils.RollupHaltOnIncompatibleProtocolVersionFlag,
utils.RollupSuperchainUpgradesFlag,
utils.ParallelTxFlag,
utils.ParallelTxNumFlag,
utils.ParallelTxDAGFlag,
utils.ParallelTxDAGFileFlag,
utils.ParallelTxDAGSenderPrivFlag,
configFileFlag,
utils.LogDebugFlag,
utils.LogBacktraceAtFlag,
Expand Down
73 changes: 72 additions & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,20 @@ import (
"encoding/hex"
"errors"
"fmt"
"github.com/ethereum/go-ethereum/core/txpool/bundlepool"
"math"
"math/big"
"net"
"net/http"
"os"
"path/filepath"
"runtime"
godebug "runtime/debug"
"strconv"
"strings"
"time"

"github.com/ethereum/go-ethereum/core/txpool/bundlepool"

pcsclite "github.com/gballet/go-libpcsclite"
gopsutil "github.com/shirou/gopsutil/mem"
"github.com/urfave/cli/v2"
Expand Down Expand Up @@ -1093,11 +1095,43 @@ Please note that --` + MetricsHTTPFlag.Name + ` must be set to start the server.
Category: flags.MetricsCategory,
}

ParallelTxFlag = &cli.BoolFlag{
Name: "parallel",
Usage: "Enable the experimental parallel transaction execution mode, only valid in full sync mode (default = false)",
Category: flags.VMCategory,
}

ParallelTxNumFlag = &cli.IntFlag{
Name: "parallel.num",
Usage: "Number of slot for transaction execution, only valid in parallel mode (runtime calculated, no fixed default value)",
Category: flags.VMCategory,
}

ParallelTxDAGFlag = &cli.BoolFlag{
Name: "parallel.txdag",
Usage: "Enable the experimental parallel TxDAG generation, only valid in full sync mode (default = false)",
Category: flags.VMCategory,
}

ParallelTxDAGFileFlag = &cli.StringFlag{
Name: "parallel.txdagfile",
Usage: "It indicates the TxDAG file path",
Value: "./parallel-txdag-output.csv",
Category: flags.VMCategory,
}

VMOpcodeOptimizeFlag = &cli.BoolFlag{
Name: "vm.opcode.optimize",
Usage: "enable opcode optimization",
Category: flags.VMCategory,
}

ParallelTxDAGSenderPrivFlag = &cli.StringFlag{
Name: "parallel.txdagsenderpriv",
Usage: "private key of the sender who sends the TxDAG transactions",
Value: "",
Category: flags.VMCategory,
}
)

var (
Expand Down Expand Up @@ -1983,6 +2017,43 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
cfg.EnablePreimageRecording = ctx.Bool(VMEnableDebugFlag.Name)
}

if ctx.IsSet(ParallelTxFlag.Name) {
cfg.ParallelTxMode = ctx.Bool(ParallelTxFlag.Name)
// The best parallel num will be tuned later, we do a simple parallel num set here
numCpu := runtime.NumCPU()
var parallelNum int
if ctx.IsSet(ParallelTxNumFlag.Name) {
// Use value set by "--parallel.num", and "--parallel.num 0" is not allowed and be set to 1
parallelNum = ctx.Int(ParallelTxNumFlag.Name)
if parallelNum < 1 {
parallelNum = 1
}
} else if numCpu == 1 {
parallelNum = 1 // single CPU core
} else {
// 1-2 core for merge (with parallel KV check)
// 1-2 core for others (bc optimizer, main)
// 1-2 core for possible other concurrent routine
parallelNum = max(1, numCpu-6)
}
cfg.ParallelTxNum = parallelNum
}

if ctx.IsSet(ParallelTxDAGFlag.Name) {
cfg.EnableParallelTxDAG = ctx.Bool(ParallelTxDAGFlag.Name)
}

if ctx.IsSet(ParallelTxDAGFileFlag.Name) {
cfg.ParallelTxDAGFile = ctx.String(ParallelTxDAGFileFlag.Name)
}

if ctx.IsSet(ParallelTxDAGSenderPrivFlag.Name) {
priHex := ctx.String(ParallelTxDAGSenderPrivFlag.Name)
if cfg.Miner.ParallelTxDAGSenderPriv, err = crypto.HexToECDSA(priHex); err != nil {
Fatalf("Failed to parse txdag private key of %s, err: %v", ParallelTxDAGSenderPrivFlag.Name, err)
}
}

if ctx.IsSet(VMOpcodeOptimizeFlag.Name) {
cfg.EnableOpcodeOptimizing = ctx.Bool(VMOpcodeOptimizeFlag.Name)
if cfg.EnableOpcodeOptimizing {
Expand Down
Loading