Skip to content

Commit

Permalink
Merge branch 'main' into PRT-add-offline-policy-v-4-2-1
Browse files Browse the repository at this point in the history
  • Loading branch information
shleikes committed Dec 15, 2024
2 parents 222c873 + 73b9e01 commit b6c136c
Show file tree
Hide file tree
Showing 165 changed files with 3,324 additions and 24,872 deletions.
10 changes: 9 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ linters:
- whitespace

issues:
exclude-files:
- "protocol/chainlib/chainproxy/rpcInterfaceMessages/grpcMessage.go"
- "protocol/chainlib/grpc.go"
- "protocol/chainlib/grpcproxy/dyncodec/remote_grpc_reflection.go"
- "protocol/chainlib/grpcproxy/dyncodec/remote_relayer.go"
- "protocol/chainlib/grpcproxy/dyncodec/remotes_test.go"
- "ecosystem/lavajs/*"
- "ecosystem/lava-sdk/*"
exclude-rules:
- text: "singleCaseSwitch"
linters:
Expand All @@ -56,7 +64,7 @@ issues:
- text: "ST1016:"
linters:
- stylecheck
- text: "SA1019:.*\"github.com/golang/protobuf/proto\" is deprecated.*" # proto is deprecated, but some places couldn't be removed
- text: 'SA1019:.*"github.com/golang/protobuf/proto" is deprecated.*' # proto is deprecated, but some places couldn't be removed
linters:
- staticcheck
- path: "migrations"
Expand Down
30 changes: 1 addition & 29 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import (
"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation"
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/auth/vesting"
Expand Down Expand Up @@ -873,34 +872,7 @@ func New(
app.setupUpgradeHandlers()

// create the simulation manager and define the order of the modules for deterministic simulations
app.sm = module.NewSimulationManager(
auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)),
bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)),
capability.NewAppModule(appCodec, *app.CapabilityKeeper, false),
feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry),
gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)),
staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)),
distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)),
slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName)),
params.NewAppModule(app.ParamsKeeper),
evidence.NewAppModule(app.EvidenceKeeper),
ibc.NewAppModule(app.IBCKeeper),
groupmodule.NewAppModule(appCodec, app.GroupKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
transferModule,
specModule,
epochstorageModule,
dualstakingModule,
subscriptionModule,
pairingModule,
conflictModule,
projectsModule,
protocolModule,
plansModule,
rewardsModule,
// this line is used by starport scaffolding # stargate/app/appModule
)
app.sm.RegisterStoreDecoders()
app.sm = module.NewSimulationManager()

// initialize stores
app.MountKVStores(keys)
Expand Down
92 changes: 0 additions & 92 deletions app/simulation_test.go

This file was deleted.

3 changes: 2 additions & 1 deletion config/provider_examples/avalanch_internal_paths_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
endpoints:
- api-interface: jsonrpc
chain-id: AVAX
network-address: 127.0.0.1:2221
network-address:
address: 127.0.0.1:2221
node-urls:
- url: ws://127.0.0.1:3333/C/rpc/ws
internal-path: "/C/rpc" # c chain like specified in the spec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ endpoints:
- api-interface: tendermintrpc
chain-id: LAV1
network-address:
address: "127.0.0.1:2220"
address: "127.0.0.1:2224"
node-urls:
- url: ws://127.0.0.1:26657/websocket
- url: http://127.0.0.1:26657
- url: http://127.0.0.1:26657
addons:
- archive
- url: https://trustless-api.com
- url: http://127.0.0.1:4444
methods:
- block
- block_by_hash
Expand All @@ -18,7 +18,7 @@ endpoints:
- api-interface: grpc
chain-id: LAV1
network-address:
address: "127.0.0.1:2220"
address: "127.0.0.1:2224"
node-urls:
- url: 127.0.0.1:9090
- url: 127.0.0.1:9090
Expand All @@ -27,7 +27,7 @@ endpoints:
- api-interface: rest
chain-id: LAV1
network-address:
address: "127.0.0.1:2220"
address: "127.0.0.1:2224"
node-urls:
- url: http://127.0.0.1:1317
- url: http://127.0.0.1:1317
Expand Down
8 changes: 6 additions & 2 deletions config/provider_examples/strk_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ endpoints:
address: "127.0.0.1:2220"
node-urls:
- url: <wss url here>/ws
internal-path: ""
internal-path: "/ws"
- url: <wss url here>/ws/rpc/v0_6
internal-path: "/rpc/v0_6"
internal-path: "/ws/rpc/v0_6"
- url: <wss url here>/ws/rpc/v0_7
internal-path: "/ws/rpc/v0_7"

- url: <https url here>
internal-path: ""
- url: <https url here>/rpc/v0_5
internal-path: "/rpc/v0_5"
- url: <https url here>/rpc/v0_6
internal-path: "/rpc/v0_6"
- url: <https url here>/rpc/v0_7
internal-path: "/rpc/v0_7"
4 changes: 2 additions & 2 deletions cookbook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Lava has many specs and participants can add and modify specs using governance p
| reliability_threshold | Threshold for VRF to decide when to do a data reliability check (i.e. re-execute query with another provider). Currently set to `268435455` on all specs resulting in a `1/16` ratio.|
| data_reliability_enabled | True/False for data reliability on/off for this spec. |
| block_distance_for_finalized_data | Blockchains like Ethereum have probabilistic finality, this threshold sets what we expect to be a safe distance from the latest block (In eth it’s 7: i.e. any block bigger in distance than 7 from the latest block we consider final).|
| blocks_in_finalization_proof | Number of finalized blocks the provider keeps (from the chain he provides service for, not always Lava) for data reliability. |
| blocks_in_finalization_proof | Number of finalized blocks the provider keeps (from the chain he provides service for, not always Lava) for data reliability. Normally, this value should be: 1sec / average_block_time |
| average_block_time | Average block time on this blockchain, used for estimating time of future blocks. |
| allowed_block_lag_for_qos_sync | Lag used to calculate QoS for providers. this should be `(10000 (10 seconds) / average_block_time) AND bigger than 1`, beyond this distance the data is considered stale and irrelevant. |
| block_last_updated | The latest block in which the spec was updated. |
Expand Down Expand Up @@ -65,7 +65,7 @@ Lava has many specs and participants can add and modify specs using governance p
| deterministic| True/False. If an API is deterministic (executing the API twice in the same block will have the same result, which means different providers are supposed to get the same result), we can run data reliability checks on it. |
| local | True/False. Marks an API that is local to the node (like subscription APIs, which are not relevant to other nodes) |
| subscription | True/False. Marks a subscription API. Requires an active connection to a node to get data pushed from a provider. |
| stateful | Requires local storage on the provider’s node. |
| stateful | True for transaction APIs. |
| hanging_api | True/False. Marks an API that is dependent on a creation of a new block (so the API hangs until this happens). |

### How to propose a new spec?
Expand Down
20 changes: 20 additions & 0 deletions cookbook/projects/policy_all_chains_with_extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,26 @@ Policy:
extensions:
- "archive"
mixed: true
- chain_id: OSMOSIS
requirements:
- collection:
api_interface: "rest"
type: "GET"
extensions:
- "archive"
mixed: true
- collection:
api_interface: "grpc"
type: ""
extensions:
- "archive"
mixed: true
- collection:
api_interface: "tendermintrpc"
type: ""
extensions:
- "archive"
mixed: true
- chain_id: COSMOSHUB
requirements:
- collection:
Expand Down
12 changes: 6 additions & 6 deletions cookbook/specs/avalanche.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
"data_reliability_enabled": true,
"block_distance_for_finalized_data": 4,
"blocks_in_finalization_proof": 3,
"average_block_time": 2500,
"allowed_block_lag_for_qos_sync": 4,
"average_block_time": 2000,
"allowed_block_lag_for_qos_sync": 5,
"imports": [
"ETH1"
],
"shares": 1,
"min_stake_provider": {
"denom": "ulava",
"amount": "47500000000"
"amount": "50000000"
},
"api_collections": [
{
Expand Down Expand Up @@ -735,12 +735,12 @@
"data_reliability_enabled": true,
"block_distance_for_finalized_data": 4,
"blocks_in_finalization_proof": 3,
"average_block_time": 2500,
"allowed_block_lag_for_qos_sync": 4,
"average_block_time": 2000,
"allowed_block_lag_for_qos_sync": 5,
"shares": 1,
"min_stake_provider": {
"denom": "ulava",
"amount": "47500000000"
"amount": "50000000"
},
"api_collections": [
{
Expand Down
Loading

0 comments on commit b6c136c

Please sign in to comment.