-
Notifications
You must be signed in to change notification settings - Fork 10
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_id
in thecampaigns
table)
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. CampaignId
should be a randomly assigned value bySentry
, we've chosen theUuid
as a random generator in Rust and uses a representation of the 16 bytes as0x
prefixed 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)
Campaign
AIP #61 v5: Sentry POST route for inserting/modifying campaign #409 (PR V5: Authenticated POST route to modify/submit campaigns #408 )- Should update
spendable
by calling theadapter.get_deposit
and updating it in the DB - v4 Channel validations should be applied on the Campaign creation (i.e. token listed, minimum deposit, current
whoami
validator in the channel & campaign validators, etc.)
- Should update
-
PUT (update)
Campaign
AIP #61 v5: Sentry POST route for inserting/modifying campaign #409 (PR V5: Authenticated POST route to modify/submit campaigns #408 )- Should update
spendable
by calling theadapter.get_deposit
and updating it in the DB - everything except
CampaignId
&Campaign.channel
is 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-manager
updatePOST ../events
route 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 separatechannels
table since we will need it for look-up when for example we want to get the lastApproveState
we need to know now only theChannel.id
(/channel/:id/...
from the route) but also theChannel.leader
to select the last approvedNewState
of the Leader (first to fetch theApproveState
and 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_analytics
with more diverse Event & params of Events (like setting hostname, referrer, etc.)