-
Notifications
You must be signed in to change notification settings - Fork 11
Description
AIP AmbireTech/adex-validator-stack-rust#61
Part of #377
Channel
As AIP#61 states the Channel is defined by (leader, follower, guardian, tokenAddr, nonce)
- Channel validation - is token allowed? is the requester a Leader or a Follower?
- No routes for storing Channels, they are gone.
- Only routes for listing all the channels (fetched by unique
channel_idin thecampaignstable)
Campaign
- A Campaign is defined by
Campaign { id: CampaignId, channel: Channel, creator, validators, title.... rest of the ChannelSpec fields }
Note: The fields were aligned with Ivo before making the changes for the Campaign. CampaignIdshould be a randomly assigned value bySentry, we've chosen theUuidas a random generator in Rust and uses a representation of the 16 bytes as0xprefixed hex string
No migration
Apart from that, we can remove obsolete fields in the ChannelSpec (v4) as the v5 will not have migration from v4 as it will work in a different way than v4.
Tasks:
- v5 Campaign & Channel PRs AdEx v5: Issue #382 Channel and Campaign #383, Issue #381 Spender aggregates - structs and setup #388 (commit 55616d4)
- Campaign Validator Issue #382 Channel and Campaign Database & Persistance #400
- Minimum token deposit & minimum validator fee Issue #382 Channel and Campaign Database & Persistance #400
Sentry
- Database changes (migrations, queries, etc)
- Campaign DB table - PR Issue #381 Spender aggregates - structs and setup #388 commit 55616d4
- Other DB tables PR Issue #381 Spender aggregates - structs and setup #388 commit 55616d4
- Insert/Fetch Campaign Issue #382 Channel and Campaign Database & Persistance #400
- Accounting (1 row = 1 spender or earner) Issue 382 campaign insert events #413
- Channel DB table Channel v5 table #432
Sentry routes
-
Clean up V4 Channel and other routes & functions Issue 382 Remove V4 Channel and fns cleanup #435
-
POST (create)
CampaignAIP #61 v5: Sentry POST route for inserting/modifying campaign #409 (PR V5: Authenticated POST route to modify/submit campaigns #408 )- Should update
spendableby calling theadapter.get_depositand updating it in the DB - v4 Channel validations should be applied on the Campaign creation (i.e. token listed, minimum deposit, current
whoamivalidator in the channel & campaign validators, etc.)
- Should update
-
PUT (update)
CampaignAIP #61 v5: Sentry POST route for inserting/modifying campaign #409 (PR V5: Authenticated POST route to modify/submit campaigns #408 )- Should update
spendableby calling theadapter.get_depositand updating it in the DB - everything except
CampaignId&Campaign.channelis mutable - Budget can changed in any direction (increase or decrease)
- Should update
-
GET (list) Campaigns AIP #61 v5: GET (list) Campaigns #429 (PR GET /v5/campaign/list #430 ) @simzzz
See how we've done this for the V4GET /channel/list- Query params:
validator- Address (not mandatory) ORleader- Address (not mandatory)
- Query params:
-
adview-managerupdatePOST ../eventsroute Adview Manager V5 changes #466 @simzzz -
GET (list) Channel - V5 Tests Tests for GET /v5/channel/list and multichain support #479
(In sentry) Use a separatechannelstable since we will need it for look-up when for example we want to get the lastApproveStatewe need to know now only theChannel.id(/channel/:id/...from the route) but also theChannel.leaderto select the last approvedNewStateof the Leader (first to fetch theApproveStateand then to get the correspondingNewState) -
POST /v5/campaign/events - insert new Event(s)
- Fees should be calculated when new Events are created Issue 382 campaign insert events #413
- Spending limits should be enforced Issue 382 campaign insert events #413
- Move everything else in analytics - AnalyticsRecorder changes
-
Analytics V5
- Analytics Analytics routes #461 (JS https://github.com/AdExNetwork/adex-validator/blob/master/routes/analyticsV5.js)
- Recorder Analytics recorder v5 #449 (JS https://github.com/AdExNetwork/adex-validator/blob/master/services/sentry/analyticsRecorderV5.js)
- Additional tests for: Additional testing for recorder + DateHour FromSql/ToSql tests #458
DateHour(& FromSql & ToSql impls)sentry::analytics::record()&sentry::db::update_analyticswith more diverse Event & params of Events (like setting hostname, referrer, etc.)