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

QLight #1363

Merged
Merged

QLight #1363

Show file tree
Hide file tree
Changes from 80 commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
282274d
qlight: introduce the qlight protocol, the corresponding server/clien…
nicolae-leonte-go Sep 24, 2021
cf86ab3
qlight: register server peers to the peer set to allow for graceful p…
nicolae-leonte-go Sep 24, 2021
fb36140
qlight poc - add support for privacy marker transaction
SatpalSandhu61 Oct 1, 2021
7fce924
qlight: add rpc proxying
nicolae-leonte-go Oct 13, 2021
2aeaaf9
qlight: sort out contract extension
nicolae-leonte-go Nov 2, 2021
773bbe4
qlight: eliminate tx receipt checks and replace with RPC calls for pr…
nicolae-leonte-go Nov 4, 2021
f445995
qlight: transfer private block data over the RPC connection (only pri…
nicolae-leonte-go Nov 10, 2021
9402032
qlight: force max peers to 1 and disable the local P2P listener for t…
nicolae-leonte-go Nov 15, 2021
4a86507
qlight: add private state root checks, restructure client cache logic
nicolae-leonte-go Nov 17, 2021
bcda8fb
qlight: apply updates from handler.go
chris-j-h Nov 23, 2021
712e78c
qlight: refactor client-side handler
chris-j-h Nov 23, 2021
10cf945
qlight: refactor server-side handler
chris-j-h Nov 23, 2021
9b4c62b
qlight: refactor server-side handler
chris-j-h Nov 23, 2021
4034638
qlight: refactor client & server-side handlers
chris-j-h Nov 24, 2021
6ce91b3
qlight: allow qlight client to start in "raft mode" and remove raft P…
nicolae-leonte-go Nov 24, 2021
7c9e9d1
qlight: refactor client handler
chris-j-h Nov 24, 2021
333bdb6
qlight: add NewBlockHashesMsg to the QLightServerProtocolManager to h…
nicolae-leonte-go Nov 25, 2021
9c77cbe
qlight: separate qlight into it's own P2P server (QP2P) on the server…
nicolae-leonte-go Nov 25, 2021
977d63e
qlight: add basic tls configuration for qlight P2P
nicolae-leonte-go Nov 25, 2021
738abd8
qlight: add file based permissioning to the qserver (qlight P2P server)
nicolae-leonte-go Nov 26, 2021
18911da
qlight: add client token cli parameter, one way tls for the RPC clien…
nicolae-leonte-go Nov 29, 2021
f3e8f04
qlight: transfer private block info over P2P protocol, remove RPC pri…
chris-j-h Nov 29, 2021
f78fd95
qlight: remove server-side cache
chris-j-h Nov 29, 2021
0d2f3b2
qlight: cleanup & remove eth_getQuorumPayloadsForBlock API
chris-j-h Nov 29, 2021
75940a7
qlight: remove unnecessary intermediary type for private data
chris-j-h Nov 30, 2021
b9c2375
qlight: add transaction notifications as empty txs in the client cach…
nicolae-leonte-go Nov 30, 2021
56ed6df
Fix error message formatting which was breaking unit test.
SatpalSandhu61 Dec 7, 2021
6da304b
qlight: move qlight initialization logic to private.InitializeConection
nicolae-leonte-go Dec 8, 2021
e9e609b
qlight: remove RegisterIdlePeer and disconnect when a qlight server c…
nicolae-leonte-go Dec 14, 2021
f31ce3f
qlight: move tls.Config construction to the qlight package
nicolae-leonte-go Dec 9, 2021
245234f
qlight: decouple private block data retrieval and authorisation from …
nicolae-leonte-go Dec 15, 2021
fb9df42
qlight: introduce the qlight protocol, the corresponding server/clien…
nicolae-leonte-go Sep 24, 2021
536713f
qlight: add rpc proxying
nicolae-leonte-go Oct 13, 2021
49d8376
qlight: register server peers to the peer set to allow for graceful p…
nicolae-leonte-go Sep 24, 2021
4652cb3
qlight: sort out contract extension
nicolae-leonte-go Nov 2, 2021
c00d186
qlight: eliminate tx receipt checks and replace with RPC calls for pr…
nicolae-leonte-go Nov 4, 2021
4a2662a
qlight: transfer private block data over the RPC connection (only pri…
nicolae-leonte-go Nov 10, 2021
a2b1a9b
qlight: add private state root checks, restructure client cache logic
nicolae-leonte-go Nov 17, 2021
af04dac
qlight: allow qlight client to start in "raft mode" and remove raft P…
nicolae-leonte-go Nov 24, 2021
9345e99
qlight: separate qlight into it's own P2P server (QP2P) on the server…
nicolae-leonte-go Nov 25, 2021
8e5017f
qlight: add file based permissioning to the qserver (qlight P2P server)
nicolae-leonte-go Nov 26, 2021
c23c900
qlight: transfer private block info over P2P protocol, remove RPC pri…
chris-j-h Nov 29, 2021
875de54
qlight: remove server-side cache
chris-j-h Nov 29, 2021
0979337
qlight: cleanup & remove eth_getQuorumPayloadsForBlock API
chris-j-h Nov 29, 2021
298d11f
qlight: remove unnecessary intermediary type for private data
chris-j-h Nov 30, 2021
64ff377
qlight: unit tests for clientCache and PrivateBlockDataResolver
nicolae-leonte-go Dec 22, 2021
8213539
qlight: fix lint issues
nicolae-leonte-go Dec 22, 2021
6a0d9ac
qlight: add auth provider tests
nicolae-leonte-go Dec 22, 2021
2448897
qlight: move qlight p2p config properties under the qlight.server.p2p…
nicolae-leonte-go Dec 23, 2021
d8427a2
qlight: add caching proxy tests
nicolae-leonte-go Jan 4, 2022
1009351
qlight: rebase and handler rewrite
nicolae-leonte-go Feb 9, 2022
df891aa
qlight: add extra tls config params
nicolae-leonte-go Feb 14, 2022
73d995c
Separate qlight client options for clarity
SatpalSandhu61 Feb 28, 2022
aa52ca6
Correction to description of qlight maxpeers option.
SatpalSandhu61 Feb 28, 2022
0cb9210
Merge branch 'master' into feature/qlight-develop-rebase
nicolae-leonte-go Mar 9, 2022
37b22ff
qlight: allow qlight to cope with un-retrievable private state roots …
nicolae-leonte-go Mar 9, 2022
546e3c8
qlight: cleanup
nicolae-leonte-go Mar 14, 2022
b29d1ce
qlight: introduce periodic checks for the qlight client token (on the…
nicolae-leonte-go Mar 14, 2022
cdc36c1
qlight: fix config unit tests
nicolae-leonte-go Mar 14, 2022
6fe9787
Merge branch 'master' into feature/qlight-develop-rebase
nicolae-leonte-go Mar 15, 2022
7834143
qlight: refactor qlight config logic
nicolae-leonte-go Mar 16, 2022
ce996a5
qlight: fix rpc tls client config
nicolae-leonte-go Mar 22, 2022
18898d0
use only 1 cacert config
namtruong Mar 22, 2022
35628cc
Merge pull request #3 from nicolae-leonte-go/qlight-develop-refactor-…
namtruong Mar 22, 2022
36d460e
qlight: error handling and constants
nicolae-leonte-go Mar 28, 2022
7638eb2
qlight: allow the client token to be updated in a running process
nicolae-leonte-go Mar 28, 2022
af01be3
use disallowed wording
baptiste-b-pegasys Mar 31, 2022
11985d5
structure qlight client config
baptiste-b-pegasys Mar 31, 2022
66fb05a
qlight: fix ExtraMetadata rlp decoding (initialize ACHashes map)
nicolae-leonte-go Mar 31, 2022
5edcd8b
Merge branch 'feature/qlight-develop-rebase' into feature/qlight-auth…
nicolae-leonte-go Mar 31, 2022
c9e1f82
qlight: add auth token config params
nicolae-leonte-go Mar 31, 2022
df37c18
Merge pull request #5 from baptiste-b-pegasys/review/qlight-config
nicolae-leonte-go Apr 1, 2022
c277c26
Merge pull request #4 from baptiste-b-pegasys/review/qlight-disallowe…
nicolae-leonte-go Apr 1, 2022
967c4aa
Merge branch 'feature/qlight-develop-rebase' into feature/qlight-auth…
nicolae-leonte-go Apr 1, 2022
96a9681
qlight: merge fixes
nicolae-leonte-go Apr 1, 2022
cc376fa
qlight: remove unnecessary break stmts
nicolae-leonte-go Apr 1, 2022
67ae56a
Merge pull request #283 from ConsenSysQuorum/feature/qlight-auth-toke…
nicolae-leonte-go Apr 1, 2022
e46ae0f
Update eth/protocols/qlight/broadcast.go
nicolae-leonte-go Apr 4, 2022
57bb424
qlight: use inclusive terms (black listed -> disallowed)
nicolae-leonte-go Apr 4, 2022
7daa19f
qlight: fix case statements
nicolae-leonte-go Apr 4, 2022
2777cfd
Update cmd/geth/config.go
antonydenyer Apr 6, 2022
5b1284a
Update cmd/geth/config.go
antonydenyer Apr 6, 2022
8c2e189
Update cmd/geth/config.go
antonydenyer Apr 6, 2022
eb5747a
Update internal/ethapi/proxy_api.go
nicolae-leonte-go Apr 6, 2022
a9c174f
Update eth/handler_qlight_client.go
nicolae-leonte-go Apr 6, 2022
e805b9b
Update internal/ethapi/proxy_api.go
nicolae-leonte-go Apr 6, 2022
94c0ab7
Update internal/ethapi/proxy_api.go
nicolae-leonte-go Apr 6, 2022
a0f3698
Update internal/ethapi/proxy_api.go
nicolae-leonte-go Apr 6, 2022
66ec704
Update node/config.go
nicolae-leonte-go Apr 6, 2022
fe95321
Update node/node.go
nicolae-leonte-go Apr 6, 2022
95d6b0c
qlight: review feedback
nicolae-leonte-go Apr 6, 2022
25b2f55
Merge branch 'master' into feature/qlight-develop-rebase
Krish1979 Apr 6, 2022
a6f15db
qlight: add pmt unit test
nicolae-leonte-go Apr 6, 2022
912dae3
Merge branch 'feature/qlight-develop-rebase' of https://github.com/ni…
nicolae-leonte-go Apr 6, 2022
d613093
qlight: add pmt unit test (check returned err)
nicolae-leonte-go Apr 6, 2022
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
75 changes: 73 additions & 2 deletions cmd/geth/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package main

import (
"bufio"
"crypto/tls"
"errors"
"fmt"
"math/big"
Expand All @@ -34,9 +35,13 @@ import (
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/permission/core"
"github.com/ethereum/go-ethereum/private"
"github.com/ethereum/go-ethereum/private/engine"
"github.com/ethereum/go-ethereum/qlight"
"github.com/naoina/toml"
"gopkg.in/urfave/cli.v1"
)
Expand Down Expand Up @@ -135,6 +140,8 @@ func makeConfigNode(ctx *cli.Context) (*node.Node, gethConfig) {

// Apply flags.
utils.SetNodeConfig(ctx, &cfg.Node)
utils.SetQLightConfig(ctx, &cfg.Node, &cfg.Eth)

stack, err := node.New(&cfg.Node)
if err != nil {
utils.Fatalf("Failed to create the protocol stack: %v", err)
Expand All @@ -144,10 +151,74 @@ func makeConfigNode(ctx *cli.Context) (*node.Node, gethConfig) {
cfg.Ethstats.URL = ctx.GlobalString(utils.EthStatsURLFlag.Name)
}
applyMetricConfig(ctx, &cfg)
if cfg.Eth.QuorumLightServer {
p2p.SetQLightTLSConfig(readQLightServerTLSConfig(ctx))
// permissioning for the qlight P2P server
stack.QServer().SetNewTransportFunc(p2p.NewQlightServerTransport)
if ctx.GlobalIsSet(utils.QuorumLightServerP2PPermissioningFlag.Name) {
prefix := "qlight"
if ctx.GlobalIsSet(utils.QuorumLightServerP2PPermissioningPrefixFlag.Name) {
prefix = ctx.GlobalString(utils.QuorumLightServerP2PPermissioningPrefixFlag.Name)
}
fbp := core.NewFileBasedPermissoningWithPrefix(prefix)
stack.QServer().SetIsNodePermissioned(fbp.IsNodePermissionedEnode)
}
}
if cfg.Eth.QuorumLightClient.Enabled() {
p2p.SetQLightTLSConfig(readQLightClientTLSConfig(ctx))
stack.Server().SetNewTransportFunc(p2p.NewQlightClientTransport)
}

return stack, cfg
}

func readQLightClientTLSConfig(ctx *cli.Context) *tls.Config {
if !ctx.GlobalIsSet(utils.QuorumLightTLSFlag.Name) {
return nil
}
if !ctx.GlobalIsSet(utils.QuorumLightTLSCACertsFlag.Name) {
utils.Fatalf("QLight tls flag is set but no client certificate authorities has been provided")
}
tlsConfig, err := qlight.ConfigureQLightTLSConfig(&qlight.TLSConfig{
CACertFileName: ctx.GlobalString(utils.QuorumLightTLSCACertsFlag.Name),
CertFileName: ctx.GlobalString(utils.QuorumLightTLSCertFlag.Name),
KeyFileName: ctx.GlobalString(utils.QuorumLightTLSKeyFlag.Name),
ServerName: enode.MustParse(ctx.GlobalString(utils.QuorumLightClientServerNodeFlag.Name)).IP().String(),
CipherSuites: ctx.GlobalString(utils.QuorumLightTLSCipherSuitesFlag.Name),
})

if err != nil {
utils.Fatalf("Unable to load the specified tls configuration: %v", err)
}
return tlsConfig
}

func readQLightServerTLSConfig(ctx *cli.Context) *tls.Config {
if !ctx.GlobalIsSet(utils.QuorumLightTLSFlag.Name) {
return nil
}
if !ctx.GlobalIsSet(utils.QuorumLightTLSCertFlag.Name) {
utils.Fatalf("QLight tls flag is set but no server certificate has been provided")
antonydenyer marked this conversation as resolved.
Show resolved Hide resolved
}
if !ctx.GlobalIsSet(utils.QuorumLightTLSKeyFlag.Name) {
utils.Fatalf("QLight tls flag is set but no server key has been provided")
antonydenyer marked this conversation as resolved.
Show resolved Hide resolved
}

tlsConfig, err := qlight.ConfigureQLightTLSConfig(&qlight.TLSConfig{
CertFileName: ctx.GlobalString(utils.QuorumLightTLSCertFlag.Name),
KeyFileName: ctx.GlobalString(utils.QuorumLightTLSKeyFlag.Name),
ClientCACertFileName: ctx.GlobalString(utils.QuorumLightTLSCACertsFlag.Name),
ClientAuth: ctx.GlobalInt(utils.QuorumLightTLSClientAuthFlag.Name),
CipherSuites: ctx.GlobalString(utils.QuorumLightTLSCipherSuitesFlag.Name),
})

if err != nil {
utils.Fatalf("QLight tls - unable to read server tls configuration: %v", err)
antonydenyer marked this conversation as resolved.
Show resolved Hide resolved
}

return tlsConfig
}

// makeFullNode loads geth configuration and creates the Ethereum backend.
func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
stack, cfg := makeConfigNode(ctx)
Expand All @@ -174,7 +245,7 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
utils.RegisterPermissionService(stack, ctx.Bool(utils.RaftDNSEnabledFlag.Name), backend.ChainConfig().ChainID)
}

if ctx.GlobalBool(utils.RaftModeFlag.Name) {
if ctx.GlobalBool(utils.RaftModeFlag.Name) && !cfg.Eth.QuorumLightClient.Enabled() {
utils.RegisterRaftService(stack, ctx, &cfg.Node, ethService)
}

Expand Down Expand Up @@ -296,7 +367,7 @@ func quorumInitialisePrivacy(ctx *cli.Context) error {
return err
}

err = private.InitialiseConnection(cfg)
err = private.InitialiseConnection(cfg, ctx.GlobalIsSet(utils.QuorumLightClientFlag.Name))
if err != nil {
return err
}
Expand Down
24 changes: 24 additions & 0 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,30 @@ var (
utils.QuorumPTMTlsClientCertFlag,
utils.QuorumPTMTlsClientKeyFlag,
utils.QuorumPTMTlsInsecureSkipVerify,
utils.QuorumLightServerFlag,
utils.QuorumLightServerP2PListenPortFlag,
utils.QuorumLightServerP2PMaxPeersFlag,
utils.QuorumLightServerP2PNetrestrictFlag,
utils.QuorumLightServerP2PPermissioningFlag,
utils.QuorumLightServerP2PPermissioningPrefixFlag,
utils.QuorumLightClientFlag,
utils.QuorumLightClientPSIFlag,
utils.QuorumLightClientTokenEnabledFlag,
utils.QuorumLightClientTokenValueFlag,
utils.QuorumLightClientTokenManagementFlag,
utils.QuorumLightClientRPCTLSFlag,
utils.QuorumLightClientRPCTLSInsecureSkipVerifyFlag,
utils.QuorumLightClientRPCTLSCACertFlag,
utils.QuorumLightClientRPCTLSCertFlag,
utils.QuorumLightClientRPCTLSKeyFlag,
utils.QuorumLightClientServerNodeFlag,
utils.QuorumLightClientServerNodeRPCFlag,
utils.QuorumLightTLSFlag,
utils.QuorumLightTLSCertFlag,
utils.QuorumLightTLSKeyFlag,
utils.QuorumLightTLSCACertsFlag,
utils.QuorumLightTLSClientAuthFlag,
utils.QuorumLightTLSCipherSuitesFlag,
// End-Quorum
}

Expand Down
29 changes: 29 additions & 0 deletions cmd/geth/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,35 @@ var AppHelpFlagGroups = []flags.FlagGroup{
utils.QuorumEnablePrivacyMarker,
},
},
{
Name: "QUORUM LIGHT CLIENT/SERVER",
Flags: []cli.Flag{
utils.QuorumLightServerFlag,
utils.QuorumLightServerP2PListenPortFlag,
utils.QuorumLightServerP2PMaxPeersFlag,
utils.QuorumLightServerP2PNetrestrictFlag,
utils.QuorumLightServerP2PPermissioningFlag,
utils.QuorumLightServerP2PPermissioningPrefixFlag,
utils.QuorumLightClientFlag,
utils.QuorumLightClientPSIFlag,
utils.QuorumLightClientTokenEnabledFlag,
utils.QuorumLightClientTokenValueFlag,
utils.QuorumLightClientTokenManagementFlag,
utils.QuorumLightClientRPCTLSFlag,
utils.QuorumLightClientRPCTLSInsecureSkipVerifyFlag,
utils.QuorumLightClientRPCTLSCACertFlag,
utils.QuorumLightClientRPCTLSCertFlag,
utils.QuorumLightClientRPCTLSKeyFlag,
utils.QuorumLightClientServerNodeFlag,
utils.QuorumLightClientServerNodeRPCFlag,
utils.QuorumLightTLSFlag,
utils.QuorumLightTLSCertFlag,
utils.QuorumLightTLSKeyFlag,
utils.QuorumLightTLSCACertsFlag,
utils.QuorumLightTLSClientAuthFlag,
utils.QuorumLightTLSCipherSuitesFlag,
},
},
{
Name: "QUORUM PRIVATE TRANSACTION MANAGER",
Flags: []cli.Flag{
Expand Down
Loading