Skip to content

Commit

Permalink
Merge branch 'develop' into test/split-runner
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis authored May 19, 2024
2 parents 879a87d + d72fdad commit 8c5534c
Show file tree
Hide file tree
Showing 62 changed files with 296 additions and 2,063 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ mocks:
@bash ./scripts/mocks-generate.sh
.PHONY: mocks

generate: proto-gen openapi specs typescript docs-zetacored
generate: proto-gen openapi specs typescript docs-zetacored mocks
.PHONY: generate

###############################################################################
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* [2071](https://github.com/zeta-chain/node/pull/2071) - Modify chains struct to add all chain related information
* [2124](https://github.com/zeta-chain/node/pull/2124) - removed unused variables and method
* [2150](https://github.com/zeta-chain/node/pull/2150) - created `chains` `zetacore` `orchestrator` packages in zetaclient and reorganized source files accordingly.
* [2205](https://github.com/zeta-chain/node/pull/2205) - remove deprecated variables pre-v17

### Tests

Expand Down
4 changes: 1 addition & 3 deletions contrib/localnet/scripts/start-zetacored.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,7 @@ then
cat $HOME/.zetacored/config/genesis.json | jq '.app_state["authority"]["policies"]["items"][0]["address"]="zeta1srsq755t654agc0grpxj4y3w0znktrpr9tcdgk"' > $HOME/.zetacored/config/tmp_genesis.json && mv $HOME/.zetacored/config/tmp_genesis.json $HOME/.zetacored/config/genesis.json
cat $HOME/.zetacored/config/genesis.json | jq '.app_state["authority"]["policies"]["items"][1]["address"]="zeta1srsq755t654agc0grpxj4y3w0znktrpr9tcdgk"' > $HOME/.zetacored/config/tmp_genesis.json && mv $HOME/.zetacored/config/tmp_genesis.json $HOME/.zetacored/config/genesis.json
cat $HOME/.zetacored/config/genesis.json | jq '.app_state["authority"]["policies"]["items"][2]["address"]="zeta1srsq755t654agc0grpxj4y3w0znktrpr9tcdgk"' > $HOME/.zetacored/config/tmp_genesis.json && mv $HOME/.zetacored/config/tmp_genesis.json $HOME/.zetacored/config/genesis.json
cat $HOME/.zetacored/config/genesis.json | jq '.app_state["observer"]["params"]["admin_policy"][0]["address"]="zeta1srsq755t654agc0grpxj4y3w0znktrpr9tcdgk"' > $HOME/.zetacored/config/tmp_genesis.json && mv $HOME/.zetacored/config/tmp_genesis.json $HOME/.zetacored/config/genesis.json
cat $HOME/.zetacored/config/genesis.json | jq '.app_state["observer"]["params"]["admin_policy"][1]["address"]="zeta1srsq755t654agc0grpxj4y3w0znktrpr9tcdgk"' > $HOME/.zetacored/config/tmp_genesis.json && mv $HOME/.zetacored/config/tmp_genesis.json $HOME/.zetacored/config/genesis.json


# give balance to runner accounts to deploy contracts directly on zEVM
# deployer
zetacored add-genesis-account zeta1uhznv7uzyjq84s3q056suc8pkme85lkvhrz3dd 100000000000000000000000000azeta
Expand Down
10 changes: 0 additions & 10 deletions contrib/localnet/zetacored/zetacored_zetacore0/config/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -634,16 +634,6 @@
"min_observer_delegation": "10000000000.000000000000000000",
"is_supported": true
}
],
"admin_policy": [
{
"policy_type": "group1",
"address": "zeta1srsq755t654agc0grpxj4y3w0znktrpr9tcdgk"
},
{
"policy_type": "group2",
"address": "zeta1srsq755t654agc0grpxj4y3w0znktrpr9tcdgk"
}
]
}
},
Expand Down
10 changes: 0 additions & 10 deletions contrib/localnet/zetacored/zetacored_zetacore1/config/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -634,16 +634,6 @@
"min_observer_delegation": "10000000000.000000000000000000",
"is_supported": true
}
],
"admin_policy": [
{
"policy_type": "group1",
"address": "zeta1srsq755t654agc0grpxj4y3w0znktrpr9tcdgk"
},
{
"policy_type": "group2",
"address": "zeta1srsq755t654agc0grpxj4y3w0znktrpr9tcdgk"
}
]
}
},
Expand Down
11 changes: 0 additions & 11 deletions docs/openapi/openapi.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57208,14 +57208,6 @@ definitions:
items:
type: object
$ref: '#/definitions/observerNode'
observerBlockHeaderVerificationFlags:
type: object
properties:
isEthTypeChainEnabled:
type: boolean
isBtcTypeChainEnabled:
type: boolean
title: 'Deprecated(v16): Use VerificationFlags in the lightclient module instead'
observerChainNonces:
type: object
properties:
Expand Down Expand Up @@ -57292,9 +57284,6 @@ definitions:
type: boolean
gasPriceIncreaseFlags:
$ref: '#/definitions/observerGasPriceIncreaseFlags'
blockHeaderVerificationFlags:
$ref: '#/definitions/observerBlockHeaderVerificationFlags'
title: 'Deprecated(v16): Use VerificationFlags in the lightclient module instead'
observerGasPriceIncreaseFlags:
type: object
properties:
Expand Down
1 change: 0 additions & 1 deletion docs/spec/observer/messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ message MsgUpdateCrosschainFlags {
bool isInboundEnabled = 3;
bool isOutboundEnabled = 4;
GasPriceIncreaseFlags gasPriceIncreaseFlags = 5;
BlockHeaderVerificationFlags blockHeaderVerificationFlags = 6;
}
```

Expand Down
9 changes: 0 additions & 9 deletions proto/zetachain/zetacore/observer/crosschain_flags.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,10 @@ message GasPriceIncreaseFlags {
uint32 maxPendingCctxs = 5;
}

// Deprecated(v16): Use VerificationFlags in the lightclient module instead
message BlockHeaderVerificationFlags {
bool isEthTypeChainEnabled = 1;
bool isBtcTypeChainEnabled = 2;
}

message CrosschainFlags {
bool isInboundEnabled = 1;
bool isOutboundEnabled = 2;
GasPriceIncreaseFlags gasPriceIncreaseFlags = 3;

// Deprecated(v16): Use VerificationFlags in the lightclient module instead
BlockHeaderVerificationFlags blockHeaderVerificationFlags = 4;
}

message LegacyCrosschainFlags {
Expand Down
1 change: 0 additions & 1 deletion proto/zetachain/zetacore/observer/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,4 @@ message EventCrosschainFlagsUpdated {
bool isOutboundEnabled = 3;
GasPriceIncreaseFlags gasPriceIncreaseFlags = 4;
string signer = 5;
BlockHeaderVerificationFlags blockHeaderVerificationFlags = 6;
}
7 changes: 0 additions & 7 deletions proto/zetachain/zetacore/observer/observer.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ enum ObserverUpdateReason {
AdminUpdate = 2;
}

// Deprecated: Use ObserverSet instead to get the list of observers
message ObserverMapper {
string index = 1;
pkg.chains.Chain observer_chain = 2;
repeated string observer_list = 4;
}

message ObserverSet { repeated string observer_list = 1; }

message LastObserverCount {
Expand Down
35 changes: 1 addition & 34 deletions proto/zetachain/zetacore/observer/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,41 +32,8 @@ message ChainParams {
bool is_supported = 16;
}

// Deprecated(v13): Use ChainParamsList
message ObserverParams {
pkg.chains.Chain chain = 1;
string ballot_threshold = 3 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
string min_observer_delegation = 4 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
bool is_supported = 5;
}

// Deprecated(v14):Moved into the authority module
enum Policy_Type {
option (gogoproto.goproto_enum_stringer) = true;
group1 = 0;
group2 = 1;
}

// Deprecated(v14):Moved into the authority module
message Admin_Policy {
Policy_Type policy_type = 1;
string address = 2;
}

// Deprecated
// Deprecated(v17)
message Params {
// Deprecated(v13): Use ChainParamsList
repeated ObserverParams observer_params = 1;

// Deprecated(v14):Moved into the authority module
repeated Admin_Policy admin_policy = 2;

// Deprecated(v17):Moved into the emissions module
int64 ballot_maturity_blocks = 3;
}
2 changes: 1 addition & 1 deletion proto/zetachain/zetacore/observer/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ message MsgUpdateCrosschainFlags {
bool isInboundEnabled = 3;
bool isOutboundEnabled = 4;
GasPriceIncreaseFlags gasPriceIncreaseFlags = 5;
BlockHeaderVerificationFlags blockHeaderVerificationFlags = 6;
}

message MsgUpdateCrosschainFlagsResponse {}

message MsgUpdateKeygen {
Expand Down
2 changes: 1 addition & 1 deletion scripts/mocks-generate.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

# Install mockery
go install github.com/vektra/mockery/v2@latest
go install github.com/vektra/mockery/v2@v2.38.0

# Run generate command for mocks
cd ./testutil/keeper/mocks
Expand Down
2 changes: 1 addition & 1 deletion testutil/keeper/mocks/crosschain/account.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion testutil/keeper/mocks/crosschain/authority.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion testutil/keeper/mocks/crosschain/bank.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion testutil/keeper/mocks/crosschain/fungible.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion testutil/keeper/mocks/crosschain/ibccrosschain.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion testutil/keeper/mocks/crosschain/lightclient.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion testutil/keeper/mocks/crosschain/observer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion testutil/keeper/mocks/crosschain/staking.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion testutil/keeper/mocks/emissions/account.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion testutil/keeper/mocks/emissions/bank.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion testutil/keeper/mocks/emissions/observer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion testutil/keeper/mocks/emissions/staking.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion testutil/keeper/mocks/fungible/account.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion testutil/keeper/mocks/fungible/authority.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion testutil/keeper/mocks/fungible/bank.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion testutil/keeper/mocks/fungible/evm.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion testutil/keeper/mocks/fungible/observer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion testutil/keeper/mocks/ibccrosschain/crosschain.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion testutil/keeper/mocks/ibccrosschain/transfer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion testutil/keeper/mocks/lightclient/authority.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion testutil/keeper/mocks/observer/authority.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion testutil/keeper/mocks/observer/lightclient.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion testutil/keeper/mocks/observer/slashing.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion testutil/keeper/mocks/observer/staking.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions testutil/network/genesis_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,9 @@ func AddObserverData(t *testing.T, n int, genesisState map[string]json.RawMessag

// set crosschain flags
crosschainFlags := &observertypes.CrosschainFlags{
IsInboundEnabled: true,
IsOutboundEnabled: true,
GasPriceIncreaseFlags: &observertypes.DefaultGasPriceIncreaseFlags,
BlockHeaderVerificationFlags: &observertypes.DefaultBlockHeaderVerificationFlags,
IsInboundEnabled: true,
IsOutboundEnabled: true,
GasPriceIncreaseFlags: &observertypes.DefaultGasPriceIncreaseFlags,
}
nullify.Fill(&crosschainFlags)
state.CrosschainFlags = crosschainFlags
Expand Down
20 changes: 0 additions & 20 deletions testutil/sample/observer.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,26 +217,6 @@ func NonceToCctxList(t *testing.T, index string, count int) []types.NonceToCctx
return list
}

func LegacyObserverMapper(t *testing.T, index string, observerList []string) *types.ObserverMapper {
r := newRandFromStringSeed(t, index)

return &types.ObserverMapper{
Index: index,
ObserverChain: Chain(r.Int63()),
ObserverList: observerList,
}
}

func LegacyObserverMapperList(t *testing.T, n int, index string) []*types.ObserverMapper {
r := newRandFromStringSeed(t, index)
observerList := []string{AccAddress(), AccAddress()}
observerMapperList := make([]*types.ObserverMapper, n)
for i := 0; i < n; i++ {
observerMapperList[i] = LegacyObserverMapper(t, fmt.Sprintf("%d-%s", r.Int63(), index), observerList)
}
return observerMapperList
}

func BallotList(n int, observerSet []string) []types.Ballot {
r := newRandFromSeed(int64(n))
ballotList := make([]types.Ballot, n)
Expand Down
Loading

0 comments on commit 8c5534c

Please sign in to comment.