Skip to content

Commit 4d06067

Browse files
committed
all: parallax virtual machine might diverge from evm in the future, so evm -> pvm
1 parent bdec7a1 commit 4d06067

File tree

211 files changed

+809
-810
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+809
-810
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# with Go source code. If you know what GOPATH is then you probably
33
# don't need to bother with make.
44

5-
.PHONY: prlx android ios evm all test clean devtools lint cross package darwin-universal release
5+
.PHONY: prlx android ios pvm all test clean devtools lint cross package darwin-universal release
66

77
GOBIN = ./build/bin
88
GO ?= latest

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ Binaries are located under `build/bin`:
4343
| `devp2p` | Networking utilities to inspect and interact at the P2P layer. |
4444
| `abigen` | Generates type-safe Go bindings from contract ABIs. |
4545
| `bootnode` | Lightweight discovery node to bootstrap networks. |
46-
| `evm` | Execute and debug EVM bytecode snippets in isolation. |
46+
| `pvm` | Execute and debug PVM bytecode snippets in isolation. |
4747
| `rlpdump` | Decode RLP structures into a human-readable form. |
48-
| `puppeth` | Wizard to create and manage custom Parallax networks. |
4948

5049
---
5150

accounts/abi/bind/backends/simulated.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ func newRevertError(result *core.ExecutionResult) *revertError {
395395
}
396396
}
397397

398-
// revertError is an API error that encompasses an EVM revert with JSON error
398+
// revertError is an API error that encompasses an PVM revert with JSON error
399399
// code and a binary data blob.
400400
type revertError struct {
401401
error
@@ -610,7 +610,7 @@ func (b *SimulatedBackend) callContract(ctx context.Context, call parallax.CallM
610610
if call.GasTipCap == nil {
611611
call.GasTipCap = new(big.Int)
612612
}
613-
// Backfill the legacy gasPrice for EVM execution, unless we're all zeroes
613+
// Backfill the legacy gasPrice for PVM execution, unless we're all zeroes
614614
call.GasPrice = new(big.Int)
615615
if call.GasFeeCap.BitLen() > 0 || call.GasTipCap.BitLen() > 0 {
616616
call.GasPrice = math.BigMin(new(big.Int).Add(call.GasTipCap, head.BaseFee), call.GasFeeCap)
@@ -630,11 +630,11 @@ func (b *SimulatedBackend) callContract(ctx context.Context, call parallax.CallM
630630
// Execute the call.
631631
msg := callMsg{call}
632632

633-
txContext := core.NewEVMTxContext(msg)
634-
evmContext := core.NewEVMBlockContext(block.Header(), b.blockchain, nil)
633+
txContext := core.NewPVMTxContext(msg)
634+
pvmContext := core.NewPVMBlockContext(block.Header(), b.blockchain, nil)
635635
// Create a new environment which holds all relevant information
636636
// about the transaction and calling mechanisms.
637-
vmEnv := vm.NewEVM(evmContext, txContext, stateDB, b.config, vm.Config{NoBaseFee: true})
637+
vmEnv := vm.NewPVM(pvmContext, txContext, stateDB, b.config, vm.Config{NoBaseFee: true})
638638
gasPool := new(core.GasPool).AddGas(math.MaxUint64)
639639

640640
return core.NewStateTransition(vmEnv, msg, gasPool).TransitionDb()

accounts/abi/bind/bind.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func Bind(types []string, abis []string, bytecodes []string, fsigs []map[string]
5959
)
6060
for i := 0; i < len(types); i++ {
6161
// Parse the actual ABI to generate the binding for
62-
evmABI, err := abi.JSON(strings.NewReader(abis[i]))
62+
pvmABI, err := abi.JSON(strings.NewReader(abis[i]))
6363
if err != nil {
6464
return "", err
6565
}
@@ -88,13 +88,13 @@ func Bind(types []string, abis []string, bytecodes []string, fsigs []map[string]
8888
eventIdentifiers = make(map[string]bool)
8989
)
9090

91-
for _, input := range evmABI.Constructor.Inputs {
91+
for _, input := range pvmABI.Constructor.Inputs {
9292
if hasStruct(input.Type) {
9393
bindStructType[lang](input.Type, structs)
9494
}
9595
}
9696

97-
for _, original := range evmABI.Methods {
97+
for _, original := range pvmABI.Methods {
9898
// Normalize the method for capital cases and non-anonymous inputs/outputs
9999
normalized := original
100100
normalizedName := methodNormalizer[lang](alias(aliases, original.Name))
@@ -135,7 +135,7 @@ func Bind(types []string, abis []string, bytecodes []string, fsigs []map[string]
135135
transacts[original.Name] = &tmplMethod{Original: original, Normalized: normalized, Structured: structured(original.Outputs)}
136136
}
137137
}
138-
for _, original := range evmABI.Events {
138+
for _, original := range pvmABI.Events {
139139
// Skip anonymous events as they don't support explicit filtering
140140
if original.Anonymous {
141141
continue
@@ -165,11 +165,11 @@ func Bind(types []string, abis []string, bytecodes []string, fsigs []map[string]
165165
events[original.Name] = &tmplEvent{Original: original, Normalized: normalized}
166166
}
167167
// Add two special fallback functions if they exist
168-
if evmABI.HasFallback() {
169-
fallback = &tmplMethod{Original: evmABI.Fallback}
168+
if pvmABI.HasFallback() {
169+
fallback = &tmplMethod{Original: pvmABI.Fallback}
170170
}
171-
if evmABI.HasReceive() {
172-
receive = &tmplMethod{Original: evmABI.Receive}
171+
if pvmABI.HasReceive() {
172+
receive = &tmplMethod{Original: pvmABI.Receive}
173173
}
174174
// There is no easy way to pass arbitrary java objects to the Go side.
175175
if len(structs) > 0 && lang == LangJava {
@@ -180,7 +180,7 @@ func Bind(types []string, abis []string, bytecodes []string, fsigs []map[string]
180180
Type: capitalise(types[i]),
181181
InputABI: strings.ReplaceAll(strippedABI, "\"", "\\\""),
182182
InputBin: strings.TrimPrefix(strings.TrimSpace(bytecodes[i]), "0x"),
183-
Constructor: evmABI.Constructor,
183+
Constructor: pvmABI.Constructor,
184184
Calls: calls,
185185
Transacts: transacts,
186186
Fallback: fallback,

accounts/abi/bind/template.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type tmplData struct {
3030
type tmplContract struct {
3131
Type string // Type name of the main contract binding
3232
InputABI string // JSON ABI used as the input to generate the binding from
33-
InputBin string // Optional EVM bytecode used to generate deploy code from
33+
InputBin string // Optional PVM bytecode used to generate deploy code from
3434
FuncSigs map[string]string // Optional map: string signature -> 4-byte signature
3535
Constructor abi.Method // Contract constructor for deploy parametrization
3636
Calls map[string]*tmplMethod // Contract calls that only read state data

accounts/abi/event.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"github.com/microstack-tech/parallax/crypto"
2525
)
2626

27-
// Event is an event potentially triggered by the EVM's LOG mechanism. The Event
27+
// Event is an event potentially triggered by the PVM's LOG mechanism. The Event
2828
// holds type information (inputs) about the yielded output. Anonymous events
2929
// don't get the signature canonical representation as the first LOG topic.
3030
type Event struct {

accounts/abi/unpack.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func ReadInteger(typ Type, b []byte) any {
6161
default:
6262
// the only case left for integer is int256
6363
// big.SetBytes can't tell if a number is negative or positive in itself.
64-
// On EVM, if the returned number > max int256, it is negative.
64+
// On PVM, if the returned number > max int256, it is negative.
6565
// A number is > max int256 if the bit at position 255 is set.
6666
ret := new(big.Int).SetBytes(b)
6767
if ret.Bit(255) == 1 {

accounts/abi/unpack_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func TestUnpack(t *testing.T) {
5858

5959
type unpackTest struct {
6060
def string // ABI definition JSON
61-
enc string // evm return data
61+
enc string // pvm return data
6262
want any // the expected output
6363
err string // empty or error if expected
6464
}

build/ci.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ var (
7575
"COPYING",
7676
executablePath("abigen"),
7777
executablePath("bootnode"),
78-
executablePath("evm"),
78+
executablePath("pvm"),
7979
executablePath("prlx"),
8080
executablePath("rlpdump"),
8181
executablePath("clef"),
@@ -92,7 +92,7 @@ var (
9292
Description: "Parallax bootnode.",
9393
},
9494
{
95-
BinaryName: "evm",
95+
BinaryName: "pvm",
9696
Description: "Developer utility version of the PVM (Parallax Virtual Machine) that is capable of running bytecode snippets within a configurable environment and execution mode.",
9797
},
9898
{

cmd/devp2p/internal/prltest/snap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ type byteCodesTest struct {
211211
var (
212212
// emptyRoot is the known root hash of an empty trie.
213213
emptyRoot = common.HexToHash("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421")
214-
// emptyCode is the known hash of the empty EVM bytecode.
214+
// emptyCode is the known hash of the empty PVM bytecode.
215215
emptyCode = common.HexToHash("c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470")
216216
)
217217

0 commit comments

Comments
 (0)