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

penumbra - pclientd integration #480

Merged
merged 41 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
0b4c133
wip penumbra pclientd
agouin Mar 21, 2023
46474af
Updates for 049-pasiphae
agouin Apr 5, 2023
5ba0f11
Merge branch 'main' into andrew/penumbra_pclientd
agouin Apr 7, 2023
ee4f4bd
build: bring in ability to pull penumbra protos & gen code
jtieri Apr 24, 2023
0d392c4
WIP: implementing missing penumbra methods + smoke test
jtieri Apr 24, 2023
79ff14e
WIP: debugging npe in grpc calls
jtieri May 5, 2023
648e373
WIP: balance by addr returns EOF
jtieri May 5, 2023
c6e36a7
update penumbra dep & change rust log level to debug
jtieri May 18, 2023
0fe7631
WIP: debugging address weirdness
jtieri Jun 8, 2023
e0836b4
use raw byte slices in getAddress
conorsch Jun 13, 2023
0ab86ec
more debugging around allocations
jtieri Jun 27, 2023
8f14e77
fix allocations file format
conorsch Jun 23, 2023
6a5e01c
handle grpc streaming request for balance
conorsch Jun 27, 2023
5a2c7e1
fix: get pcli balance checks working + remove debug output
jtieri Jun 29, 2023
3770e33
remove more debug output
jtieri Jun 29, 2023
3c36f7f
cleanup tx build, auth, broadcast logic + implement func for handling…
jtieri Jul 6, 2023
32f2856
update protos
jtieri Jul 6, 2023
df5bf4c
filter balances for target denom
jtieri Jul 6, 2023
13e89af
fix proto gen issue in client.pb.go
jtieri Jul 11, 2023
aa41ee8
get balance checks completely working
jtieri Jul 11, 2023
486217b
Merge remote-tracking branch 'origin' into andrew/penumbra_pclientd
jtieri Aug 2, 2023
fba94af
update penumbra 0.57.0, pull new protos, adjust code to account for b…
jtieri Aug 2, 2023
3ae3594
WIP: working on testing local transfers on penumbra
jtieri Aug 4, 2023
eb14aec
get balance checks working again + adjust test assertions
jtieri Aug 8, 2023
15bb77f
fix get addr and update protos
jtieri Aug 8, 2023
9eef521
update protos and continue work on smoke test
jtieri Aug 22, 2023
4e1f1d4
update to penumbra v0.60.0 and begin cleanup
jtieri Sep 12, 2023
a47132b
more cleanup
jtieri Sep 13, 2023
8143c91
Merge branch 'main' into andrew/penumbra_pclientd
jtieri Sep 13, 2023
5a7bd8b
update protos for ictest v8
jtieri Sep 13, 2023
2b48896
Merge branch 'main' into andrew/penumbra_pclientd
jtieri Sep 13, 2023
757e816
update penumbra protos for ibc-go v8 support
jtieri Sep 13, 2023
bd2eef9
Merge branch 'main' into andrew/penumbra_pclientd
jtieri Sep 13, 2023
86183ca
Merge branch 'main' into andrew/penumbra_pclientd
jtieri Sep 18, 2023
41d5099
fix: adjust polkadot docker calls to pass env arg
jtieri Sep 18, 2023
5f24804
fix: adjust penumbra implementation with new assumptions in mind
jtieri Sep 20, 2023
649cada
chore: remove unused code and cleanup comments
jtieri Sep 20, 2023
f23c66e
Merge branch 'main' into andrew/penumbra_pclientd
jtieri Sep 20, 2023
d7d560e
chore: remove unnecessary todos
jtieri Sep 22, 2023
5ca5510
chore: use more descriptive homedir for pclientd config files
jtieri Sep 22, 2023
8a0cdc4
chore: implement HomeDir method + utilize const for abci port
jtieri Sep 22, 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
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
DOCKER := $(shell which docker)
protoVer=0.13.2
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)

default: help

.PHONY: help
Expand All @@ -23,4 +28,9 @@ docker-mac-nuke: ## macOS only. Try docker-reset first. Kills and restarts Docke

.PHONY: gen
gen: ## Run code generators
go generate ./...
go generate ./...

.PHONY: proto-gen
proto-gen: ## Generate code from protos
@echo "Generating Protobuf files"
@$(protoImage) sh ./scripts/protocgen.sh
2 changes: 1 addition & 1 deletion chain/cosmos/chain_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,7 @@ func (tn *ChainNode) CreateNodeContainer(ctx context.Context) error {
cmd = []string{chainCfg.Bin, "start", "--home", tn.HomeDir(), "--x-crisis-skip-assert-invariants"}
}

return tn.containerLifecycle.CreateContainer(ctx, tn.TestName, tn.NetworkID, tn.Image, sentryPorts, tn.Bind(), tn.HostName(), cmd)
return tn.containerLifecycle.CreateContainer(ctx, tn.TestName, tn.NetworkID, tn.Image, sentryPorts, tn.Bind(), tn.HostName(), cmd, nil)
}

func (tn *ChainNode) StartContainer(ctx context.Context) error {
Expand Down
2 changes: 1 addition & 1 deletion chain/cosmos/sidecar.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (s *SidecarProcess) logger() *zap.Logger {
}

func (s *SidecarProcess) CreateContainer(ctx context.Context) error {
return s.containerLifecycle.CreateContainer(ctx, s.TestName, s.NetworkID, s.Image, s.ports, s.Bind(), s.HostName(), s.startCmd)
return s.containerLifecycle.CreateContainer(ctx, s.TestName, s.NetworkID, s.Image, s.ports, s.Bind(), s.HostName(), s.startCmd, nil)
}

func (s *SidecarProcess) StartContainer(ctx context.Context) error {
Expand Down
39 changes: 36 additions & 3 deletions chain/internal/tendermint/tendermint_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
rpcclient "github.com/cometbft/cometbft/rpc/client"
rpchttp "github.com/cometbft/cometbft/rpc/client/http"
libclient "github.com/cometbft/cometbft/rpc/jsonrpc/client"
volumetypes "github.com/docker/docker/api/types/volume"
dockerclient "github.com/docker/docker/client"
"github.com/docker/go-connections/nat"
"github.com/hashicorp/go-version"
Expand All @@ -39,13 +40,45 @@ type TendermintNode struct {
containerLifecycle *dockerutil.ContainerLifecycle
}

func NewTendermintNode(log *zap.Logger, i int, c ibc.Chain, dockerClient *dockerclient.Client, networkID string, testName string, image ibc.DockerImage) *TendermintNode {
func NewTendermintNode(
ctx context.Context,
log *zap.Logger,
i int,
c ibc.Chain,
dockerClient *dockerclient.Client,
networkID string,
testName string,
image ibc.DockerImage,
) (*TendermintNode, error) {
tn := &TendermintNode{Log: log, Index: i, Chain: c,
DockerClient: dockerClient, NetworkID: networkID, TestName: testName, Image: image}

tn.containerLifecycle = dockerutil.NewContainerLifecycle(log, dockerClient, tn.Name())

return tn
tv, err := dockerClient.VolumeCreate(ctx, volumetypes.CreateOptions{
Labels: map[string]string{
dockerutil.CleanupLabel: testName,
dockerutil.NodeOwnerLabel: tn.Name(),
},
})
if err != nil {
return nil, fmt.Errorf("creating tendermint volume: %w", err)
}
tn.VolumeName = tv.Name
if err := dockerutil.SetVolumeOwner(ctx, dockerutil.VolumeOwnerOptions{
Log: log,

Client: dockerClient,

VolumeName: tn.VolumeName,
ImageRef: tn.Image.Ref(),
TestName: tn.TestName,
UidGid: tn.Image.UidGid,
}); err != nil {
return nil, fmt.Errorf("set tendermint volume owner: %w", err)
}

return tn, nil
}

// TendermintNodes is a collection of TendermintNode
Expand Down Expand Up @@ -226,7 +259,7 @@ func (tn *TendermintNode) CreateNodeContainer(ctx context.Context, additionalFla
cmd := []string{chainCfg.Bin, "start", "--home", tn.HomeDir()}
cmd = append(cmd, additionalFlags...)

return tn.containerLifecycle.CreateContainer(ctx, tn.TestName, tn.NetworkID, tn.Image, sentryPorts, tn.Bind(), tn.HostName(), cmd)
return tn.containerLifecycle.CreateContainer(ctx, tn.TestName, tn.NetworkID, tn.Image, sentryPorts, tn.Bind(), tn.HostName(), cmd, nil)
}

func (tn *TendermintNode) StopContainer(ctx context.Context) error {
Expand Down
Loading