Skip to content

Commit

Permalink
CNS-288 create basic pairing of project providers (lavanet#358)
Browse files Browse the repository at this point in the history
* working pairing :)

* verify pairing returns number of providers and cu

* add compute units

* fix cu validation

* added tests

* pr changes

* bug fix

* merge fixes

* added vrfs to project developer keys

* added scripts and come quality of life changes

* getpairing tested

* fix merge problems

* solve test problem

* fix e2e requirements in config.yml

* support legacy

* fixed issues with providers

* PR review fixes

* Delete rpcconsumer.yml

* Update msg_server_relay_payment.go

* fix a mistake in error handling

---------

Co-authored-by: Yarom Swisa <[email protected] git config --global user.name Yarom>
Co-authored-by: omer mishael <[email protected]>
Co-authored-by: Omer <[email protected]>
  • Loading branch information
4 people authored Mar 16, 2023
1 parent 8ef954c commit cfdf8e7
Show file tree
Hide file tree
Showing 55 changed files with 4,680 additions and 1,168 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ testutil/debugging/

# Misc
scripts/vars/
rpcconsumer.yml
17 changes: 9 additions & 8 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,14 @@ func New(
)
epochstorageModule := epochstoragemodule.NewAppModule(appCodec, app.EpochstorageKeeper, app.AccountKeeper, app.BankKeeper)

app.ProjectsKeeper = *projectsmodulekeeper.NewKeeper(
appCodec,
keys[projectsmoduletypes.StoreKey],
keys[projectsmoduletypes.MemStoreKey],
app.GetSubspace(projectsmoduletypes.ModuleName),
)
projectsModule := projectsmodule.NewAppModule(appCodec, app.ProjectsKeeper)

app.PairingKeeper = *pairingmodulekeeper.NewKeeper(
appCodec,
keys[pairingmoduletypes.StoreKey],
Expand All @@ -447,17 +455,10 @@ func New(
app.AccountKeeper,
app.SpecKeeper,
&app.EpochstorageKeeper,
app.ProjectsKeeper,
)
pairingModule := pairingmodule.NewAppModule(appCodec, app.PairingKeeper, app.AccountKeeper, app.BankKeeper)

app.ProjectsKeeper = *projectsmodulekeeper.NewKeeper(
appCodec,
keys[projectsmoduletypes.StoreKey],
keys[projectsmoduletypes.MemStoreKey],
app.GetSubspace(projectsmoduletypes.ModuleName),
)
projectsModule := projectsmodule.NewAppModule(appCodec, app.ProjectsKeeper)

app.SubscriptionKeeper = *subscriptionmodulekeeper.NewKeeper(
appCodec,
keys[subscriptionmoduletypes.StoreKey],
Expand Down
23 changes: 10 additions & 13 deletions cookbook/plans/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,19 @@
"description": "A proposal of a default plan",
"plans": [
{
"duration": "1",
"index": "DefaultPlan",
"description": "This plan has no restrictions",
"type": "rpc",
"price": {
"denom": "ulava",
"amount": "2"
"amount": "100000"
},
"allow_overuse": true,
"block": "10",
"index": "DefaultPlanID",
"compute_units": "25920",
"compute_units_per_epoch": "1",
"servicers_to_pair": "2",
"overuse_rate": "1",
"name": "DefaultPlan",
"description": "This plan has no restrictions",
"type": "rpc",
"annual_discount_percentage": "20"
"annual_discount_percentage": "20",
"compute_units": "10000000000",
"compute_units_per_epoch": "1000",
"max_providers_to_pair": "5",
"allow_overuse": false,
"overuse_rate": "0"
}
]
},
Expand Down
Loading

0 comments on commit cfdf8e7

Please sign in to comment.