Skip to content

Commit

Permalink
fix SetGenesis to also add L1Block (0xPolygonHermez#898)
Browse files Browse the repository at this point in the history
  • Loading branch information
tclemos authored Jul 15, 2022
1 parent 1d7ca97 commit 43030a3
Show file tree
Hide file tree
Showing 19 changed files with 285 additions and 213 deletions.
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,12 @@ test-e2e-group-1: build-docker compile-scs ## Runs group 1 e2e tests checking ra
.PHONY: test-e2e-group-2
test-e2e-group-2: build-docker compile-scs ## Runs group 2 e2e tests checking race conditions
$(STOPDB)
$(STOPZKPROVER)
$(RUNDB); sleep 7
trap '$(STOPDB)' EXIT; MallocNanoZone=0 go test -race -p 1 -timeout 600s ./ci/e2e-group2/...
$(RUNZKPROVER)
docker ps -a
docker logs $(DOCKERCOMPOSEZKPROVER)
trap '$(STOPDB) && $(STOPZKPROVER)' EXIT; MallocNanoZone=0 go test -race -p 1 -timeout 600s ./ci/e2e-group2/...

.PHONY: test-e2e-group-3
test-e2e-group-3: build-docker compile-scs ## Runs group 3 e2e tests checking race conditions
Expand Down Expand Up @@ -247,10 +251,8 @@ install-git-hooks: ## Moves hook files to the .git/hooks directory

.PHONY: generate-mocks
generate-mocks: ## Generates mocks for the tests, using mockery tool
mockery --name=etherman --dir=sequencer/strategy/txprofitabilitychecker --output=sequencer/strategy/txprofitabilitychecker --outpkg=txprofitabilitychecker_test --filename=etherman-mock_test.go
mockery --name=batchProcessor --dir=sequencer/strategy/txselector --output=sequencer/strategy/txselector --outpkg=txselector_test --filename=batchprocessor-mock_test.go
mockery --name=etherman --dir=sequencer/profitabilitychecker --output=sequencer/profitabilitychecker --outpkg=profitabilitychecker_test --filename=etherman-mock_test.go
mockery --name=etherman --dir=sequencer --output=sequencer --outpkg=sequencer --structname=ethermanMock --filename=etherman-mock_test.go
mockery --name=Store --dir=state/tree --output=state/tree --outpkg=tree --structname=storeMock --filename=store-mock_test.go

mockery --name=storageInterface --dir=jsonrpc --output=jsonrpc --outpkg=jsonrpc --inpackage --structname=storageMock --filename=mock_storage_test.go
mockery --name=jsonRPCTxPool --dir=jsonrpc --output=jsonrpc --outpkg=jsonrpc --inpackage --structname=poolMock --filename=mock_pool_test.go
Expand Down
1 change: 0 additions & 1 deletion ci/e2e-group2/jsonrpc_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion config/config.debug.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Port = 50060
StoreBackend = "PostgreSQL"

[MTClient]
URI = "127.0.0.1:50060"
URI = "127.0.0.1:50061"

[Executor]
URI = "127.0.0.1:50071"
Expand Down
4 changes: 2 additions & 2 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func Test_Defaults(t *testing.T) {
},
{
path: "MTClient.URI",
expectedValue: "127.0.0.1:50060",
expectedValue: "127.0.0.1:50061",
},
{
path: "Database.MaxConns",
Expand All @@ -138,7 +138,7 @@ func Test_Defaults(t *testing.T) {
},
{
path: "Executor.URI",
expectedValue: "51.210.116.237:50071",
expectedValue: "127.0.0.1:50071",
},
{
path: "BroadcastServer.Host",
Expand Down
6 changes: 3 additions & 3 deletions config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ EnableLog = false
MaxConns = 200
[Etherman]
URL = "http://localhost"
URL = "http://localhost:8545"
PrivateKeyPath = "./test/test.keystore"
PrivateKeyPassword = "testonly"
Expand Down Expand Up @@ -75,10 +75,10 @@ Port = 50060
StoreBackend = "PostgreSQL"
[MTClient]
URI = "127.0.0.1:50060"
URI = "127.0.0.1:50061"
[Executor]
URI = "51.210.116.237:50071"
URI = "127.0.0.1:50071"
[BroadcastServer]
Host = "0.0.0.0"
Expand Down
2 changes: 2 additions & 0 deletions merkletree/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ func NewMTDBServiceClient(ctx context.Context, c Config) (pb.StateDBServiceClien
const maxWaitSeconds = 120
ctx, cancel := context.WithTimeout(ctx, maxWaitSeconds*time.Second)

log.Infof("trying to connect to merkletree: %v", c.URI)
mtDBConn, err := grpc.DialContext(ctx, c.URI, opts...)
if err != nil {
log.Fatalf("fail to dial: %v", err)
}
log.Infof("connected to merkletree")

mtDBClient := pb.NewStateDBServiceClient(mtDBConn)
return mtDBClient, mtDBConn, cancel
Expand Down
Loading

0 comments on commit 43030a3

Please sign in to comment.