Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop 1.11.5 #1

Open
wants to merge 169 commits into
base: 1.11
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
169 commits
Select commit Hold shift + click to select a range
7859e5f
Rebranding for 1.9.8
devintegral2 Dec 3, 2019
5e8fbc7
Replace eth->ftm in web3.js
devintegral2 Dec 3, 2019
f741a5c
change eth namespace to ftm namespace in web3.js
uprendis Sep 29, 2020
071217f
Refactoring "eth" -> "ftm" for web3ext
devintegral2 Dec 4, 2019
738bf78
Fix version record
devintegral2 Dec 4, 2019
f45b5b8
console: no modules renaming
Dec 26, 2019
5b55105
console: hide eth module
Dec 26, 2019
0f98fd3
ftm in unitMap
Dec 26, 2019
2e3d450
mutable version
Dec 26, 2019
82aa4ef
Add web3.utils.toMoniker method
Mar 12, 2020
7c97ce0
Declaration for toMoniker
Mar 13, 2020
38484cc
Add fmt methods to web3.js
Mar 17, 2020
213711a
Remove unused web3.js methods
Mar 17, 2020
724599f
Fix getConsensusTime return value
Mar 18, 2020
ce62838
Add formaters for web3.js methods
Mar 18, 2020
acb4b98
Fix new formatter for web3.js
Mar 18, 2020
cf858a7
Add formatters for web3.js
Mar 18, 2020
b192e7d
Add all fmt methods in web3.js
Mar 19, 2020
babbeee
Fix new methods
Mar 19, 2020
f6bc784
Slice debug methods in debug namespace
Mar 20, 2020
0b35000
Fix error for module web3/methods/debug
Mar 20, 2020
9f865a9
Slice sfc methods in sfc namespace
Mar 20, 2020
2b0da99
Fixes for web3.js
Mar 20, 2020
dde2663
Add output formatters for debug methods
Mar 20, 2020
3aa2273
Fix errors in web3.js formatter
Mar 20, 2020
7dcd75d
Fix errors in web3.js formatter
Mar 20, 2020
2207d03
Optimize formatters code
Mar 20, 2020
020608b
Output formatters for sfc methods
Mar 20, 2020
9c8bc9b
Fix error in output formatter
Mar 20, 2020
765377e
Add devintegral3 author in web3.js header
Mar 23, 2020
aadf0d0
Use decimal integer for output staker ID
Mar 23, 2020
04771e9
Use decimal integer for output staker ID
Mar 23, 2020
ccc3b09
Add output formatters for delegators
Mar 23, 2020
bbf657a
web3js: fix timestampNano formatting for getBlock
uprendis Jul 30, 2020
26f375b
web3js: fix getStakers(0) formatting
uprendis Jul 30, 2020
93ed034
web3js: refactor delegations formatting
uprendis Jul 30, 2020
d14496f
web3js: refactor histogram formatting
uprendis Jul 30, 2020
ee49da5
web3js: add debug.blocksTPS, debug.blocksTransactionTimes, rename ttf…
uprendis Jul 30, 2020
337fe8a
web3js: rename delegator -> delegation, add sfc.getDelegationsByAddress
uprendis Jul 30, 2020
dae4daa
web3js: go generate
uprendis Sep 29, 2020
1c0a15a
less verbose peer stats
uprendis Oct 5, 2020
c65a867
evm: add precompiled state contracts
uprendis Feb 3, 2021
81019f7
web3.js: abft
rus-alex Mar 29, 2021
894c881
web3.js: rm unused imports
rus-alex Mar 29, 2021
50fa4e3
web3.js: dag
rus-alex Mar 30, 2021
ea8962f
web3.js: go generate
rus-alex Mar 30, 2021
fa32fc1
netutil.PortListeners()
rus-alex Apr 26, 2021
f2ccaba
p2p/server checks if port is already in use
rus-alex Apr 26, 2021
b2cd54e
netutil.PortListeners() -> netutil.UdpPortListeners()
rus-alex Apr 26, 2021
bba39c7
add TransactionsByPriceAndNonce.Copy() method
uprendis Apr 21, 2021
b37c803
go mod tidy
uprendis May 25, 2021
8d39e9d
rename Geth->Opera in disk space logs
uprendis May 26, 2021
dc9dcb8
configurable maximum number of snap layers
uprendis May 31, 2021
8b2bbac
add tx.SetHash method
uprendis Jun 22, 2021
e01f22b
add cached signer
uprendis May 1, 2021
260884e
netstat nop for others
rus-alex Jul 31, 2021
96ea9e9
API fix: block hash
rus-alex Aug 6, 2021
e95a583
ethclient wraps dag API
rus-alex Aug 6, 2021
7c52346
DAG API should be wrapped by go-opera/ethclient
rus-alex Aug 10, 2021
4491e2a
MinFreeDiskSpaceFlag is 8192 by default
uprendis Sep 2, 2021
ff1bac7
allow manual block hash caching
uprendis Oct 11, 2021
89b7927
more clear block hash
rus-alex Oct 11, 2021
a65cf94
CopyHeader() update
rus-alex Oct 11, 2021
4ea903e
Merge pull request #21 from uprendis/develop-1.10.8-updated
quan8 Nov 8, 2021
fba01df
Receipts.DeriveFields accepts Signer instead of ChainConfig
uprendis Nov 16, 2021
721b87d
Merge pull request #22 from uprendis/feature/optimize-receipts-deriving
quan8 Nov 17, 2021
63ba82e
snap.BlockChain interface instead of *core.BlockChain
rus-alex Nov 9, 2021
fdaff84
Merge pull request #23 from rus-alex/blockchain-interface-segregation
quan8 Dec 16, 2021
a122f97
apply changes
cyberbono3 Dec 20, 2021
e86aa64
Merge pull request #24 from cyberbono3/update-snap-protocolname
quan8 Dec 20, 2021
24fae9e
eth/protocols/snap, trie: better error-handling
holiman Sep 27, 2021
adab511
demote verbosity for missing snapshot diffs
uprendis Dec 20, 2021
fae0451
demote verbosity for missing snapshot
uprendis Dec 20, 2021
edae874
Merge pull request #25 from uprendis/feature/merge-better-error-handling
quan8 Dec 22, 2021
bb6c998
Merge pull request #26 from uprendis/feature/less-verbose-snapshot-mi…
quan8 Dec 22, 2021
5c99f07
add snapshot.Tree.Generating method
uprendis Dec 22, 2021
889c41a
demote verbosity for outdated snapshot journal
uprendis Dec 23, 2021
3db2e88
Merge pull request #27 from uprendis/feature/add-snap-generating-check
quan8 Dec 23, 2021
31f4dc4
core,eth: call frame tracing (#23087)
s1na Sep 17, 2021
e2be1ac
UdpPortListeners() err is not fatal
rus-alex Feb 19, 2022
8dec1a2
UdpPortListeners() skips disabled sockets
rus-alex Feb 19, 2022
e57afb7
trie: prunning state trie node on disk
hadv Feb 22, 2022
97d9b81
fix nil pointer reference
hadv Feb 23, 2022
4586c4c
still delete the ditry node when calling cap
hadv Feb 23, 2022
fcbc4eb
using callback to tracking the commited node
hadv Feb 25, 2022
32e9ee5
delete the previously committed node as well
hadv Feb 25, 2022
ee6af93
use map to tracking the commited node
hadv Feb 25, 2022
19f050c
adding log
hadv Feb 26, 2022
56a354c
check delete like dereference
hadv Feb 27, 2022
2af123e
lower the commited node log level to debug
hadv Feb 28, 2022
804d288
double check nil for cached node
hadv Feb 28, 2022
d334666
use commited flag instead of map
hadv Feb 28, 2022
c63577f
delete trie node if already committed
hadv Feb 28, 2022
09209f4
only update flush-list for uncommitted node
hadv Mar 1, 2022
8937214
fix typo
hadv Mar 2, 2022
f208069
adding more error logs
hadv Mar 3, 2022
778b950
Merge pull request #30 from uprendis/develop-1.10.8-txtracing
uprendis Mar 4, 2022
9df86be
add trie node deletion log
hadv Mar 7, 2022
1371851
use separate db wrapper to tracking commited node
hadv Mar 7, 2022
544d31f
simplify the greedy put
hadv Mar 8, 2022
a828786
add insert trie node log
hadv Mar 9, 2022
0c7710b
mark node as commited if node does not existing on db
hadv Mar 9, 2022
b0d4d73
eth/protocols/snap: avoid estimating infinite percentage
hadv Mar 10, 2022
10a2542
use persistent store directly
hadv Mar 14, 2022
c46b49e
prevent possible duplicate write on the same dirty node
hadv Mar 14, 2022
b470c2f
change some log level to easy monitor the log
hadv Mar 14, 2022
3d85b82
remove logs
hadv Mar 15, 2022
1650319
trie: move node into the clean cache to prevent insta-reloads
hadv Mar 15, 2022
d722ca2
don't re-commit previously committed node
hadv Mar 15, 2022
0d77fc1
evict dirty node in the greedy gc as well if node is db existing
hadv Mar 15, 2022
79c861b
remove unnecessary code
hadv Mar 16, 2022
4263abf
rpc handler timeout
rus-alex Mar 24, 2022
8c951d4
Revert "rpc handler timeout"
rus-alex Mar 30, 2022
23df62c
rpc/callbackc.call() timeout
rus-alex Apr 4, 2022
f33b70b
5 sec timeout
rus-alex Apr 11, 2022
4087d8d
Merge pull request #32 from rus-alex/feature/api-deadline
uprendis Apr 16, 2022
402969f
greedy gc: reverse order of batch writing and replaying
hadv May 3, 2022
dc868c7
get back original ethereum error log messages
hadv Jun 8, 2022
25a683c
remove adding error logs
hadv Jun 8, 2022
3ca8292
Merge pull request #29 from hadv/trie-state-prunning
quan8 Jun 9, 2022
aa62ade
Merge pull request #31 from hadv/fix_inf
quan8 Jun 9, 2022
31e4934
Merge pull request #28 from rus-alex/fix/netstat-check
uprendis Jun 17, 2022
0651a40
cmd, p2p: implement sentry node
hadv Jul 14, 2022
a70c386
p2p/discover: correct the netrestrict checking in UDPv5
hadv Jul 15, 2022
7fabf0b
get rid of validator node out of the found node in UDPv5
hadv Jul 15, 2022
a8ffe54
refactor code and add ip restrict test for dial
hadv Jul 21, 2022
210582f
allow update iprestrict/private ip via admin console
hadv Jul 22, 2022
e4a94df
also remove the peer if it's not in the updated ip restrict
hadv Jul 22, 2022
bdf7ed4
update peer set when setting ip restrict from nil
hadv Jul 22, 2022
3ceffaa
add admin property to tracking iprestrict and private nodes on console
hadv Jul 22, 2022
e578c33
should remove node from peers, not from static nodes
hadv Jul 22, 2022
9c1f899
p2p hanlde will manage the peers itself
hadv Jul 22, 2022
e970911
allow node to handle peers via dial config
hadv Jul 22, 2022
8141e1d
try to call dialsched peer removed after ip restrict be updated
hadv Jul 22, 2022
fb92b6c
only remove the peers when ip restrict is not-nil
hadv Jul 22, 2022
08324f0
remove all new admin console methods
hadv Jul 26, 2022
2b6434a
config private node list by enode
hadv Jul 26, 2022
d47eb05
show more info for private node list
hadv Jul 27, 2022
50cc96c
correct private notes flag usage description
hadv Aug 2, 2022
61d2a2a
polish the usage description for private nodes flag
hadv Aug 2, 2022
4826d95
Merge pull request #35 from hadv/sentry-node
uprendis Aug 3, 2022
a8619dc
add error handling for parsing of IPrestrictFlag/PrivateNodeFlag flags
uprendis Aug 12, 2022
89097a4
Merge pull request #36 from uprendis/feature/ip-flags-err-handling
uprendis Aug 12, 2022
b59b8df
eth/tracers: fix callTracer fault handling (#23667)
s1na Oct 1, 2021
133089e
Merge pull request #37 from hkalina/backport-23667
uprendis Sep 1, 2022
66dace0
Block non-opera nodes from discovery
Sep 19, 2022
03acb91
Add possibility to configure RPC execution time limit
Sep 15, 2022
a8badd2
p2p: add private nodes as static node as well
hadv Sep 29, 2022
40179b9
ethdb: use leveldb stats struct instead of parsing the stats in strin…
hadv Jun 23, 2022
208c28f
node: add private node as trusted node as well
hadv Oct 25, 2022
08e00ba
update code and add some test cases
hadv Oct 26, 2022
2b28808
Merge pull request #40 from hadv/static-node
uprendis Nov 15, 2022
ee56663
Merge pull request #39 from hkalina/jkalina-discovery-opera
uprendis Nov 15, 2022
d862fc5
Merge pull request #38 from hkalina/jkalina-timeout
uprendis Nov 15, 2022
139e457
supress useless peers in discovery
uprendis Nov 16, 2022
3e25561
Merge pull request #41 from hadv/leveldb-stats
uprendis Nov 17, 2022
3cf614f
suppress verbosity of snapsync warnings
uprendis Dec 8, 2022
2b54480
Merge pull request #42 from uprendis/feature/suppress-snapsync-warns
uprendis Dec 8, 2022
0a1113e
wait for calls finish on rpc.Server.Stop()
rus-alex Jan 27, 2023
426ade5
Merge pull request #43 from rus-alex/fix/api-graceful-stop
uprendis Jan 30, 2023
7115ccc
merge with develop-1.10.8
hadv Apr 4, 2023
c8c2aed
make tnx message for some specific purposes
hadv Apr 7, 2023
2e6f0ed
cmd, miner, node: make node to compability with opera
hadv Apr 21, 2023
4573c14
core/state: add debug log when updating state object
hadv May 4, 2023
3d0baff
core/state: don't update state for 0x0 address
hadv May 4, 2023
e10b196
Revert "core/state: don't update state for 0x0 address"
hadv May 15, 2023
114fe6c
core/state: add log for state object
hadv May 15, 2023
df0ff08
core/state: remove debug logs
hadv May 16, 2023
5b894ac
add snapMaxLayers setting
hadv May 30, 2023
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
10 changes: 5 additions & 5 deletions build/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ var (
// A debian package is created for all executables listed here.
debEthereum = debPackage{
Name: "ethereum",
Version: params.Version,
Version: params.Version(),
Executables: debExecutables,
}

Expand Down Expand Up @@ -512,12 +512,12 @@ func doDocker(cmdline []string) {
case env.Branch == "master":
tags = []string{"latest"}
case strings.HasPrefix(env.Tag, "v1."):
tags = []string{"stable", fmt.Sprintf("release-1.%d", params.VersionMinor), "v" + params.Version}
tags = []string{"stable", fmt.Sprintf("release-1.%d", params.VersionMinor), "v" + params.Version()}
}
// If architecture specific image builds are requested, build and push them
if *image {
build.MustRunCommand("docker", "build", "--build-arg", "COMMIT="+env.Commit, "--build-arg", "VERSION="+params.VersionWithMeta, "--build-arg", "BUILDNUM="+env.Buildnum, "--tag", fmt.Sprintf("%s:TAG", *upload), ".")
build.MustRunCommand("docker", "build", "--build-arg", "COMMIT="+env.Commit, "--build-arg", "VERSION="+params.VersionWithMeta, "--build-arg", "BUILDNUM="+env.Buildnum, "--tag", fmt.Sprintf("%s:alltools-TAG", *upload), "-f", "Dockerfile.alltools", ".")
build.MustRunCommand("docker", "build", "--build-arg", "COMMIT="+env.Commit, "--build-arg", "VERSION="+params.VersionWithMeta(), "--build-arg", "BUILDNUM="+env.Buildnum, "--tag", fmt.Sprintf("%s:TAG", *upload), ".")
build.MustRunCommand("docker", "build", "--build-arg", "COMMIT="+env.Commit, "--build-arg", "VERSION="+params.VersionWithMeta(), "--build-arg", "BUILDNUM="+env.Buildnum, "--tag", fmt.Sprintf("%s:alltools-TAG", *upload), "-f", "Dockerfile.alltools", ".")

// Tag and upload the images to Docker Hub
for _, tag := range tags {
Expand Down Expand Up @@ -993,7 +993,7 @@ func doWindowsInstaller(cmdline []string) {
// Build the installer. This assumes that all the needed files have been previously
// built (don't mix building and packaging to keep cross compilation complexity to a
// minimum).
version := strings.Split(params.Version, ".")
version := strings.Split(params.Version(), ".")
if env.Commit != "" {
version[2] += "-" + env.Commit[:8]
}
Expand Down
68 changes: 0 additions & 68 deletions cmd/geth/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ import (

"github.com/urfave/cli/v2"

"github.com/ethereum/go-ethereum/accounts/external"
"github.com/ethereum/go-ethereum/accounts/keystore"
"github.com/ethereum/go-ethereum/accounts/scwallet"
"github.com/ethereum/go-ethereum/accounts/usbwallet"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/eth/downloader"
"github.com/ethereum/go-ethereum/eth/ethconfig"
Expand Down Expand Up @@ -141,11 +137,6 @@ func makeConfigNode(ctx *cli.Context) (*node.Node, gethConfig) {
if err != nil {
utils.Fatalf("Failed to create the protocol stack: %v", err)
}
// Node doesn't by default populate account manager backends
if err := setAccountManagerBackends(stack); err != nil {
utils.Fatalf("Failed to set account manager backends: %v", err)
}

utils.SetEthConfig(ctx, stack, &cfg.Eth)
if ctx.IsSet(utils.EthStatsURLFlag.Name) {
cfg.Ethstats.URL = ctx.String(utils.EthStatsURLFlag.Name)
Expand Down Expand Up @@ -268,62 +259,3 @@ func deprecated(field string) bool {
return false
}
}

func setAccountManagerBackends(stack *node.Node) error {
conf := stack.Config()
am := stack.AccountManager()
keydir := stack.KeyStoreDir()
scryptN := keystore.StandardScryptN
scryptP := keystore.StandardScryptP
if conf.UseLightweightKDF {
scryptN = keystore.LightScryptN
scryptP = keystore.LightScryptP
}

// Assemble the supported backends
if len(conf.ExternalSigner) > 0 {
log.Info("Using external signer", "url", conf.ExternalSigner)
if extapi, err := external.NewExternalBackend(conf.ExternalSigner); err == nil {
am.AddBackend(extapi)
return nil
} else {
return fmt.Errorf("error connecting to external signer: %v", err)
}
}

// For now, we're using EITHER external signer OR local signers.
// If/when we implement some form of lockfile for USB and keystore wallets,
// we can have both, but it's very confusing for the user to see the same
// accounts in both externally and locally, plus very racey.
am.AddBackend(keystore.NewKeyStore(keydir, scryptN, scryptP))
if conf.USB {
// Start a USB hub for Ledger hardware wallets
if ledgerhub, err := usbwallet.NewLedgerHub(); err != nil {
log.Warn(fmt.Sprintf("Failed to start Ledger hub, disabling: %v", err))
} else {
am.AddBackend(ledgerhub)
}
// Start a USB hub for Trezor hardware wallets (HID version)
if trezorhub, err := usbwallet.NewTrezorHubWithHID(); err != nil {
log.Warn(fmt.Sprintf("Failed to start HID Trezor hub, disabling: %v", err))
} else {
am.AddBackend(trezorhub)
}
// Start a USB hub for Trezor hardware wallets (WebUSB version)
if trezorhub, err := usbwallet.NewTrezorHubWithWebUSB(); err != nil {
log.Warn(fmt.Sprintf("Failed to start WebUSB Trezor hub, disabling: %v", err))
} else {
am.AddBackend(trezorhub)
}
}
if len(conf.SmartCardDaemonPath) > 0 {
// Start a smart card hub
if schub, err := scwallet.NewHub(conf.SmartCardDaemonPath, scwallet.Scheme, keydir); err != nil {
log.Warn(fmt.Sprintf("Failed to start smart card hub, disabling: %v", err))
} else {
am.AddBackend(schub)
}
}

return nil
}
4 changes: 2 additions & 2 deletions cmd/geth/consolecmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func TestConsoleWelcome(t *testing.T) {

// Verify the actual welcome message to the required template
geth.Expect(`
Welcome to the Geth JavaScript console!
Welcome to the Lachesis JavaScript console!

instance: Geth/v{{gethver}}/{{goos}}-{{goarch}}/{{gover}}
coinbase: {{.Etherbase}}
Expand Down Expand Up @@ -140,7 +140,7 @@ func testAttachWelcome(t *testing.T, geth *testgeth, endpoint, apis string) {

// Verify the actual welcome message to the required template
attach.Expect(`
Welcome to the Geth JavaScript console!
Welcome to the Lachesis JavaScript console!

instance: Geth/v{{gethver}}/{{goos}}-{{goarch}}/{{gover}}
coinbase: {{etherbase}}
Expand Down
4 changes: 2 additions & 2 deletions cmd/geth/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var customGenesisTests = []struct {
"timestamp" : "0x00",
"config" : {}
}`,
query: "eth.getBlock(0).nonce",
query: "ftm.getBlock(0).nonce",
result: "0x0000000000001338",
},
// Genesis file with specific chain configurations
Expand All @@ -64,7 +64,7 @@ var customGenesisTests = []struct {
"daoForkSupport" : true
}
}`,
query: "eth.getBlock(0).nonce",
query: "ftm.getBlock(0).nonce",
result: "0x0000000000001339",
},
}
Expand Down
2 changes: 2 additions & 0 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ var (
utils.NoDiscoverFlag,
utils.DiscoveryV5Flag,
utils.NetrestrictFlag,
utils.IPrestrictFlag,
utils.PrivateNodeFlag,
utils.NodeKeyFileFlag,
utils.NodeKeyHexFlag,
utils.DNSDiscoveryFlag,
Expand Down
2 changes: 1 addition & 1 deletion cmd/geth/misccmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func printVersion(ctx *cli.Context) error {
git, _ := version.VCS()

fmt.Println(strings.Title(clientIdentifier))
fmt.Println("Version:", params.VersionWithMeta)
fmt.Println("Version:", params.VersionWithMeta())
if git.Commit != "" {
fmt.Println("Git Commit:", git.Commit)
}
Expand Down
29 changes: 24 additions & 5 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,14 @@ var (
Usage: "Restricts network communication to the given IP networks (CIDR masks)",
Category: flags.NetworkingCategory,
}
IPrestrictFlag = &cli.StringFlag{
Name: "iprestrict",
Usage: "Restricts network communication to the given IP addresses",
}
PrivateNodeFlag = &cli.StringFlag{
Name: "privatenodes",
Usage: "Comma separated enode URLs which must not be advertised as peers to public network",
}
DNSDiscoveryFlag = &cli.StringFlag{
Name: "discovery.dns",
Usage: "Sets DNS discovery entry points (use \"\" to disable DNS)",
Expand Down Expand Up @@ -1414,11 +1422,7 @@ func SetP2PConfig(ctx *cli.Context, cfg *p2p.Config) {
if !(lightClient || lightServer) {
lightPeers = 0
}
ethPeers := cfg.MaxPeers - lightPeers
if lightClient {
ethPeers = 0
}
log.Info("Maximum peer count", "ETH", ethPeers, "LES", lightPeers, "total", cfg.MaxPeers)
log.Info("Maximum peer count", "total", cfg.MaxPeers)

if ctx.IsSet(MaxPendingPeersFlag.Name) {
cfg.MaxPendingPeers = ctx.Int(MaxPendingPeersFlag.Name)
Expand All @@ -1445,6 +1449,21 @@ func SetP2PConfig(ctx *cli.Context, cfg *p2p.Config) {
cfg.NetRestrict = list
}

var err error
if iprestrict := ctx.String(IPrestrictFlag.Name); iprestrict != "" {
cfg.IPRestrict, err = netutil.ParseIPs(iprestrict)
if err != nil {
Fatalf("Option %q: %v", IPrestrictFlag.Name, err)
}
}

if privatenodes := ctx.String(PrivateNodeFlag.Name); privatenodes != "" {
cfg.PrivateNodes, err = enode.ParseNodes(privatenodes)
if err != nil {
Fatalf("Option %q: %v", PrivateNodeFlag.Name, err)
}
}

if ctx.Bool(DeveloperFlag.Name) {
// --dev mode can't use p2p networking.
cfg.MaxPeers = 0
Expand Down
13 changes: 7 additions & 6 deletions console/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,7 @@ func (c *Console) initExtensions() error {
return err
}
}

// Compute aliases from server-provided modules.
aliases := map[string]struct{}{"eth": {}}
aliases := map[string]struct{}{"ftm": {}, "personal": {}}
for api := range apis {
if api == "web3" {
continue
Expand Down Expand Up @@ -320,15 +318,15 @@ func (c *Console) AutoCompleteInput(line string, pos int) (string, []string, str
// Welcome show summary of current Geth instance and some metadata about the
// console's available modules.
func (c *Console) Welcome() {
message := "Welcome to the Geth JavaScript console!\n\n"
message := "Welcome to the Lachesis JavaScript console!\n\n"

// Print some generic Geth metadata
if res, err := c.jsre.Run(`
var message = "instance: " + web3.version.node + "\n";
try {
message += "coinbase: " + eth.coinbase + "\n";
message += "coinbase: " + ftm.coinbase + "\n";
} catch (err) {}
message += "at block: " + eth.blockNumber + " (" + new Date(1000 * eth.getBlock(eth.blockNumber).timestamp) + ")\n";
message += "at block: " + ftm.blockNumber + " (" + new Date(1000 * ftm.getBlock(ftm.blockNumber).timestamp) + ")\n";
try {
message += " datadir: " + admin.datadir + "\n";
} catch (err) {}
Expand All @@ -340,6 +338,9 @@ func (c *Console) Welcome() {
if apis, err := c.client.SupportedModules(); err == nil {
modules := make([]string, 0, len(apis))
for api, version := range apis {
if api == "eth" {
continue // hide module
}
modules = append(modules, fmt.Sprintf("%s:%s", api, version))
}
sort.Strings(modules)
Expand Down
1 change: 1 addition & 0 deletions core/state/snapshot/journal.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"time"

"github.com/VictoriaMetrics/fastcache"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/ethdb"
Expand Down
6 changes: 5 additions & 1 deletion core/state/snapshot/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,11 @@ func (t *Tree) generating() (bool, error) {
return layer.genMarker != nil, nil
}

// DiskRoot is a external helper function to return the disk layer root.
func (t *Tree) Generating() (bool, error) {
return t.generating()
}

// diskRoot is a external helper function to return the disk layer root.
func (t *Tree) DiskRoot() common.Hash {
t.lock.Lock()
defer t.lock.Unlock()
Expand Down
18 changes: 12 additions & 6 deletions core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,11 @@ type StateDB struct {
// It will be updated when the Commit is called.
originalRoot common.Hash

snaps *snapshot.Tree
snap snapshot.Snapshot
snapAccounts map[common.Hash][]byte
snapStorage map[common.Hash]map[common.Hash][]byte
snaps *snapshot.Tree
snap snapshot.Snapshot
snapAccounts map[common.Hash][]byte
snapStorage map[common.Hash]map[common.Hash][]byte
snapMaxLayers int

// This map holds 'live' objects, which will get modified while processing a state transition.
stateObjects map[common.Address]*stateObject
Expand Down Expand Up @@ -131,6 +132,10 @@ type StateDB struct {

// New creates a new state from a given trie.
func New(root common.Hash, db Database, snaps *snapshot.Tree) (*StateDB, error) {
return NewWithSnapLayers(root, db, snaps, 128)
}

func NewWithSnapLayers(root common.Hash, db Database, snaps *snapshot.Tree, layers int) (*StateDB, error) {
tr, err := db.OpenTrie(root)
if err != nil {
return nil, err
Expand All @@ -150,6 +155,7 @@ func New(root common.Hash, db Database, snaps *snapshot.Tree) (*StateDB, error)
accessList: newAccessList(),
transientStorage: newTransientStorage(),
hasher: crypto.NewKeccakState(),
snapMaxLayers: layers,
}
if sdb.snaps != nil {
if sdb.snap = sdb.snaps.Snapshot(root); sdb.snap != nil {
Expand Down Expand Up @@ -1050,8 +1056,8 @@ func (s *StateDB) Commit(deleteEmptyObjects bool) (common.Hash, error) {
// - head layer is paired with HEAD state
// - head-1 layer is paired with HEAD-1 state
// - head-127 layer(bottom-most diff layer) is paired with HEAD-127 state
if err := s.snaps.Cap(root, 128); err != nil {
log.Warn("Failed to cap snapshot tree", "root", root, "layers", 128, "err", err)
if err := s.snaps.Cap(root, s.snapMaxLayers); err != nil {
log.Warn("Failed to cap snapshot tree", "root", root, "layers", s.snapMaxLayers, "err", err)
}
}
if metrics.EnabledExpensive {
Expand Down
19 changes: 19 additions & 0 deletions core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ type Message struct {
GasTipCap *big.Int
Data []byte
AccessList types.AccessList
IsFake bool

// When SkipAccountCheckss is true, the message nonce is not checked against the
// account nonce in state. It also disables checking that the sender is an EOA.
Expand All @@ -154,6 +155,7 @@ func TransactionToMessage(tx *types.Transaction, s types.Signer, baseFee *big.In
Value: tx.Value(),
Data: tx.Data(),
AccessList: tx.AccessList(),
IsFake: false,
SkipAccountChecks: false,
}
// If baseFee provided, set gasPrice to effectiveGasPrice.
Expand All @@ -165,6 +167,23 @@ func TransactionToMessage(tx *types.Transaction, s types.Signer, baseFee *big.In
return msg, err
}

func NewMessage(from common.Address, to *common.Address, nonce uint64, value *big.Int, gasLimit uint64, gasPrice, gasFeeCap, gasTipCap *big.Int, data []byte, accessList types.AccessList, isFake bool) *Message {
return &Message{
From: from,
To: to,
Nonce: nonce,
Value: value,
GasLimit: gasLimit,
GasPrice: gasPrice,
GasFeeCap: gasFeeCap,
GasTipCap: gasTipCap,
Data: data,
AccessList: accessList,
IsFake: isFake,
SkipAccountChecks: false,
}
}

// ApplyMessage computes the new state by applying the given message
// against the old state within the environment.
//
Expand Down
Loading