Skip to content

Commit

Permalink
integrations: misc bug fixes (ethereum#66)
Browse files Browse the repository at this point in the history
* docker: update entrypoint

* docker: update entrypoints

* flags: address resolver address

* docker: handle entrypoint

* sync service: channel bug

* flags: parse env vars

* syncservice: typo fixes

* rollup: dial

* rollup: channel fix

* syncservice: chan

* sync service: fix defer

* rollup: fixes

* rollup: remove networkid

* rollup: delete l1 to l2 contract references

* sync service: remove retry logic

* rollup: use address manager

* rollup: note blockheight gotcha

* rollup: extra logging

* rollup: better closing of channel

* backend: don't start p2p server

* rollup: more logging

* rollup: bugfix

* sync service: better error checking

* verify networkid

* rollup: temp hardhat workaround

* rollup: hardhat workaround

* rollup: hardhat workaround

* contracts: use new contracts

* syncservice: skip submission if no queue elements

* flags: more

* flags: price price 0

* gas price: set 0

* rollup: initialze sync status with lock

* rollup: add more logging

* rollup: handle reorgs, poll instead of subscribe

* rollup: remove is sufficiently old check

* rollup: better logging

* eth: remove logline

* rollup: more loglines

* rollup: more logs

* rollup: remove sufficiently old logic

* rollup: try no copy append

* rollup: fix executed property setting on rollup tx

* rollup: more logging

* rollup: more loglines

* rollup: better logging

* rollup: move lock to higher level

* rollup: remove maybe applytx

* rollup: sync mechanism v0

* rollup: logging

* build: fix

* rollup: extra logging

* rollup: use for loop instead of range

* rollup: remove sync logic

* rollup: re add sync method

* rollup: debug log

* rollup: remove sync method

* sync service: add index to meta, sort by index in miner

* rollup: cleanups
  • Loading branch information
tynes authored Nov 2, 2020
1 parent 3f08abe commit e11fe6d
Show file tree
Hide file tree
Showing 15 changed files with 817 additions and 248 deletions.
2 changes: 1 addition & 1 deletion cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ var (
utils.TxIngestionSignerKeyFileFlag,
// Flags for the SyncService
utils.Eth1SyncServiceEnable,
utils.Eth1AddressResolverAddressFlag,
utils.Eth1CanonicalTransactionChainDeployHeightFlag,
utils.Eth1CanonicalTransactionChainAddressFlag,
utils.Eth1L1toL2TransactionQueueAddressFlag,
utils.Eth1SequencerDecompressionAddressFlag,
utils.Eth1ChainIdFlag,
utils.Eth1NetworkIdFlag,
Expand Down
2 changes: 1 addition & 1 deletion cmd/geth/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ var AppHelpFlagGroups = []flagGroup{
utils.TxIngestionSignerKeyHexFlag,
utils.TxIngestionSignerKeyFileFlag,
utils.Eth1SyncServiceEnable,
utils.Eth1AddressResolverAddressFlag,
utils.Eth1CanonicalTransactionChainDeployHeightFlag,
utils.Eth1CanonicalTransactionChainAddressFlag,
utils.Eth1L1toL2TransactionQueueAddressFlag,
utils.Eth1SequencerDecompressionAddressFlag,
utils.Eth1ChainIdFlag,
utils.Eth1NetworkIdFlag,
Expand Down
193 changes: 112 additions & 81 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,10 @@ func printHelp(out io.Writer, templ string, data interface{}) {
var (
// General settings
DataDirFlag = DirectoryFlag{
Name: "datadir",
Usage: "Data directory for the databases and keystore",
Value: DirectoryString(node.DefaultDataDir()),
Name: "datadir",
Usage: "Data directory for the databases and keystore",
Value: DirectoryString(node.DefaultDataDir()),
EnvVar: "DATADIR",
}
AncientFlag = DirectoryFlag{
Name: "datadir.ancient",
Expand All @@ -153,18 +154,20 @@ var (
Usage: "Directory for the keystore (default = inside the datadir)",
}
NoUSBFlag = cli.BoolFlag{
Name: "nousb",
Usage: "Disables monitoring for and managing USB hardware wallets",
Name: "nousb",
Usage: "Disables monitoring for and managing USB hardware wallets",
EnvVar: "NO_USB",
}
SmartCardDaemonPathFlag = cli.StringFlag{
Name: "pcscdpath",
Usage: "Path to the smartcard daemon (pcscd) socket file",
Value: pcsclite.PCSCDSockName,
}
NetworkIdFlag = cli.Uint64Flag{
Name: "networkid",
Usage: "Network identifier (integer, 1=Frontier, 2=Morden (disused), 3=Ropsten, 4=Rinkeby)",
Value: eth.DefaultConfig.NetworkId,
Name: "networkid",
Usage: "Network identifier (integer, 1=Frontier, 2=Morden (disused), 3=Ropsten, 4=Rinkeby)",
Value: eth.DefaultConfig.NetworkId,
EnvVar: "NETWORK_ID",
}
TestnetFlag = cli.BoolFlag{
Name: "testnet",
Expand All @@ -179,8 +182,9 @@ var (
Usage: "Görli network: pre-configured proof-of-authority test network",
}
DeveloperFlag = cli.BoolFlag{
Name: "dev",
Usage: "Ephemeral proof-of-authority network with a pre-funded developer account, mining enabled",
Name: "dev",
Usage: "Ephemeral proof-of-authority network with a pre-funded developer account, mining enabled",
EnvVar: "DEV",
}
DeveloperPeriodFlag = cli.IntFlag{
Name: "dev.period",
Expand Down Expand Up @@ -222,9 +226,10 @@ var (
Value: &defaultSyncMode,
}
GCModeFlag = cli.StringFlag{
Name: "gcmode",
Usage: `Blockchain garbage collection mode ("full", "archive")`,
Value: "full",
Name: "gcmode",
Usage: `Blockchain garbage collection mode ("full", "archive")`,
Value: "full",
EnvVar: "GCMODE",
}
LightKDFFlag = cli.BoolFlag{
Name: "lightkdf",
Expand Down Expand Up @@ -421,24 +426,27 @@ var (
Value: eth.DefaultConfig.Miner.GasFloor,
}
MinerLegacyGasTargetFlag = cli.Uint64Flag{
Name: "targetgaslimit",
Usage: "Target gas floor for mined blocks (deprecated, use --miner.gastarget)",
Value: eth.DefaultConfig.Miner.GasFloor,
Name: "targetgaslimit",
Usage: "Target gas floor for mined blocks (deprecated, use --miner.gastarget)",
Value: eth.DefaultConfig.Miner.GasFloor,
EnvVar: "TARGET_GAS_LIMIT",
}
MinerGasLimitFlag = cli.Uint64Flag{
Name: "miner.gaslimit",
Usage: "Target gas ceiling for mined blocks",
Value: eth.DefaultConfig.Miner.GasCeil,
}
MinerGasPriceFlag = BigFlag{
Name: "miner.gasprice",
Usage: "Minimum gas price for mining a transaction",
Value: eth.DefaultConfig.Miner.GasPrice,
Name: "miner.gasprice",
Usage: "Minimum gas price for mining a transaction",
Value: big.NewInt(0),
EnvVar: "GASPRICE",
}
MinerLegacyGasPriceFlag = BigFlag{
Name: "gasprice",
Usage: "Minimum gas price for mining a transaction (deprecated, use --miner.gasprice)",
Value: eth.DefaultConfig.Miner.GasPrice,
Name: "gasprice",
Usage: "Minimum gas price for mining a transaction (deprecated, use --miner.gasprice)",
Value: big.NewInt(0),
EnvVar: "GASPRICE",
}
MinerEtherbaseFlag = cli.StringFlag{
Name: "miner.etherbase",
Expand Down Expand Up @@ -510,65 +518,77 @@ var (
}
// RPC settings
IPCDisabledFlag = cli.BoolFlag{
Name: "ipcdisable",
Usage: "Disable the IPC-RPC server",
Name: "ipcdisable",
Usage: "Disable the IPC-RPC server",
EnvVar: "IPC_DISABLE",
}
IPCPathFlag = DirectoryFlag{
Name: "ipcpath",
Usage: "Filename for IPC socket/pipe within the datadir (explicit paths escape it)",
}
RPCEnabledFlag = cli.BoolFlag{
Name: "rpc",
Usage: "Enable the HTTP-RPC server",
Name: "rpc",
Usage: "Enable the HTTP-RPC server",
EnvVar: "RPC_ENABLE",
}
RPCListenAddrFlag = cli.StringFlag{
Name: "rpcaddr",
Usage: "HTTP-RPC server listening interface",
Value: node.DefaultHTTPHost,
Name: "rpcaddr",
Usage: "HTTP-RPC server listening interface",
Value: node.DefaultHTTPHost,
EnvVar: "RPC_ADDR",
}
RPCPortFlag = cli.IntFlag{
Name: "rpcport",
Usage: "HTTP-RPC server listening port",
Value: node.DefaultHTTPPort,
Name: "rpcport",
Usage: "HTTP-RPC server listening port",
Value: node.DefaultHTTPPort,
EnvVar: "RPC_PORT",
}
RPCCORSDomainFlag = cli.StringFlag{
Name: "rpccorsdomain",
Usage: "Comma separated list of domains from which to accept cross origin requests (browser enforced)",
Value: "",
Name: "rpccorsdomain",
Usage: "Comma separated list of domains from which to accept cross origin requests (browser enforced)",
Value: "",
EnvVar: "RPC_CORS_DOMAIN",
}
RPCVirtualHostsFlag = cli.StringFlag{
Name: "rpcvhosts",
Usage: "Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard.",
Value: strings.Join(node.DefaultConfig.HTTPVirtualHosts, ","),
Name: "rpcvhosts",
Usage: "Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard.",
Value: strings.Join(node.DefaultConfig.HTTPVirtualHosts, ","),
EnvVar: "RPC_VHOSTS",
}
RPCApiFlag = cli.StringFlag{
Name: "rpcapi",
Usage: "API's offered over the HTTP-RPC interface",
Value: "",
Name: "rpcapi",
Usage: "API's offered over the HTTP-RPC interface",
Value: "",
EnvVar: "RPC_API",
}
WSEnabledFlag = cli.BoolFlag{
Name: "ws",
Usage: "Enable the WS-RPC server",
Name: "ws",
Usage: "Enable the WS-RPC server",
EnvVar: "WS",
}
WSListenAddrFlag = cli.StringFlag{
Name: "wsaddr",
Usage: "WS-RPC server listening interface",
Value: node.DefaultWSHost,
Name: "wsaddr",
Usage: "WS-RPC server listening interface",
Value: node.DefaultWSHost,
EnvVar: "WS_ADDR",
}
WSPortFlag = cli.IntFlag{
Name: "wsport",
Usage: "WS-RPC server listening port",
Value: node.DefaultWSPort,
Name: "wsport",
Usage: "WS-RPC server listening port",
Value: node.DefaultWSPort,
EnvVar: "WS_PORT",
}
WSApiFlag = cli.StringFlag{
Name: "wsapi",
Usage: "API's offered over the WS-RPC interface",
Value: "",
Name: "wsapi",
Usage: "API's offered over the WS-RPC interface",
Value: "",
EnvVar: "WS_API",
}
WSAllowedOriginsFlag = cli.StringFlag{
Name: "wsorigins",
Usage: "Origins from which to accept websockets requests",
Value: "",
Name: "wsorigins",
Usage: "Origins from which to accept websockets requests",
Value: "",
EnvVar: "WS_ORIGINS",
}
GraphQLEnabledFlag = cli.BoolFlag{
Name: "graphql",
Expand Down Expand Up @@ -648,8 +668,9 @@ var (
Value: "any",
}
NoDiscoverFlag = cli.BoolFlag{
Name: "nodiscover",
Usage: "Disables the peer discovery mechanism (manual peer addition)",
Name: "nodiscover",
Usage: "Disables the peer discovery mechanism (manual peer addition)",
EnvVar: "NO_DISCOVER",
}
DiscoveryV5Flag = cli.BoolFlag{
Name: "v5disc",
Expand Down Expand Up @@ -797,41 +818,51 @@ var (
}
// New Transaction Ingestion Flags
Eth1SyncServiceEnable = cli.BoolFlag{
Name: "eth1.syncservice",
Usage: "Enable the sync service",
Name: "eth1.syncservice",
Usage: "Enable the sync service",
EnvVar: "ETH1_SYNC_SERVICE_ENABLE",
}
Eth1CanonicalTransactionChainDeployHeightFlag = cli.StringFlag{
Name: "eth1.ctcdeploymentheight",
Usage: "Deployment of the canonical transaction chain",
Name: "eth1.ctcdeploymentheight",
Usage: "Deployment of the canonical transaction chain",
EnvVar: "ETH1_CTC_DEPLOYMENT_HEIGHT",
}
Eth1CanonicalTransactionChainAddressFlag = cli.StringFlag{
Name: "eth1.ctcaddress",
Usage: "Deployment address of the canonical transaction chain",
}
Eth1L1toL2TransactionQueueAddressFlag = cli.StringFlag{
Name: "eth1.queueaddress",
Usage: "Deployment address of the L1 to L2 transaction queue",
Name: "eth1.ctcaddress",
Usage: "Deployment address of the canonical transaction chain",
EnvVar: "ETH1_CTC_ADDRESS",
}
Eth1SequencerDecompressionAddressFlag = cli.StringFlag{
Name: "eth1.sequencerdecompressionaddress",
Usage: "Deployment address of the sequencer decompression contract",
Name: "eth1.sequencerdecompressionaddress",
Usage: "Deployment address of the sequencer decompression contract",
EnvVar: "ETH1_DECOMPRESSION_ADDRESS",
}
Eth1AddressResolverAddressFlag = cli.StringFlag{
Name: "eth1.addressresolveraddress",
Usage: "Deployment address of the address resolver contract",
Value: "0x0000000000000000000000000000000000000000",
EnvVar: "ETH1_ADDRESS_RESOLVER_ADDRESS",
}
Eth1ChainIdFlag = cli.Uint64Flag{
Name: "eth1.chainid",
Usage: "Network identifier (integer, 1=Frontier, 2=Morden (disused), 3=Ropsten, 4=Rinkeby)",
Name: "eth1.chainid",
Usage: "Network identifier (integer, 1=Frontier, 2=Morden (disused), 3=Ropsten, 4=Rinkeby)",
EnvVar: "ETH1_CHAINID",
}
Eth1NetworkIdFlag = cli.Uint64Flag{
Name: "eth1.networkid",
Usage: "Network identifier (integer, 1=Frontier, 2=Morden (disused), 3=Ropsten, 4=Rinkeby)",
Name: "eth1.networkid",
Usage: "Network identifier (integer, 1=Frontier, 2=Morden (disused), 3=Ropsten, 4=Rinkeby)",
EnvVar: "ETH1_NETWORKID",
}
Eth1HTTPFlag = cli.StringFlag{
Name: "eth1.http",
Usage: "HTTP endpoint of an eth 1 node",
Name: "eth1.http",
Usage: "HTTP endpoint of an eth 1 node",
EnvVar: "ETH1_HTTP",
}
// Flag to enable verifier mode
RollupEnableVerifierFlag = cli.BoolFlag{
Name: "rollup.verifier",
Usage: "Enable the verifier",
Name: "rollup.verifier",
Usage: "Enable the verifier",
EnvVar: "ROLLUP_VERIFIER_ENABLE",
}
)

Expand Down Expand Up @@ -1107,14 +1138,14 @@ func setEth1(ctx *cli.Context, cfg *rollup.Config) {
height := ctx.GlobalUint64(Eth1CanonicalTransactionChainDeployHeightFlag.Name)
cfg.CanonicalTransactionChainDeployHeight = new(big.Int).SetUint64(height)
}
if ctx.GlobalIsSet(Eth1AddressResolverAddressFlag.Name) {
addr := ctx.GlobalString(Eth1AddressResolverAddressFlag.Name)
cfg.AddressResolverAddress = common.HexToAddress(addr)
}
if ctx.GlobalIsSet(Eth1CanonicalTransactionChainAddressFlag.Name) {
addr := ctx.GlobalString(Eth1CanonicalTransactionChainAddressFlag.Name)
cfg.CanonicalTransactionChainAddress = common.HexToAddress(addr)
}
if ctx.GlobalIsSet(Eth1L1toL2TransactionQueueAddressFlag.Name) {
addr := ctx.GlobalString(Eth1L1toL2TransactionQueueAddressFlag.Name)
cfg.L1ToL2TransactionQueueAddress = common.HexToAddress(addr)
}
if ctx.GlobalIsSet(Eth1SequencerDecompressionAddressFlag.Name) {
addr := ctx.GlobalString(Eth1SequencerDecompressionAddressFlag.Name)
cfg.SequencerDecompressionAddress = common.HexToAddress(addr)
Expand Down
Loading

0 comments on commit e11fe6d

Please sign in to comment.