Traffic-Based App Reward: Support bootstrapping with TBA enabled#5685
Traffic-Based App Reward: Support bootstrapping with TBA enabled#5685adetokunbo wants to merge 9 commits into
Conversation
24c8172 to
7331734
Compare
f5477c0 to
2391a94
Compare
2391a94 to
8134561
Compare
dfordivam
left a comment
There was a problem hiding this comment.
See comments, the logic needs to allow the first SV to bump meta userVersion + us to bump codeVersion
| // The first SV has complete history from genesis, so round 0 is always | ||
| // the earliest complete round. The query still runs to confirm ingestion | ||
| // has started (returns None if no meta row or no activity records). | ||
| case Some(_) if isFirstSv => Some(0L) |
There was a problem hiding this comment.
This means the first SV will never be able to update activity meta?
We should check earliest_ingested_round is 0 and only then return 0. Else fallback to the Some value.
There was a problem hiding this comment.
I tried that initially, but earliest_ingested_round value as 3 reflecting where the FAP grant was as added, so that check did not work. That's why I've adopted this approach that does not depend on its value. As you have pointed out, as originally implemented this was incorrect, as it blocked bumping the meta versions on firstSV; the latest commit fixes this; PTAL
| } | ||
| } | ||
|
|
||
| "return round 0 on first SV even when ingestion started after genesis" in { |
There was a problem hiding this comment.
what is the intention behind this?
We have to handle the ingestion "started" after genesis gracefully right?
There was a problem hiding this comment.
I've updated the descriptions; PTAL
8134561 to
cb47c8e
Compare
55595d4 to
9f9f141
Compare
| case Some((firstRecordTimeMicros, earliestRound)) => | ||
| // First SV on fresh network: earliest complete round is | ||
| // always 0, so override the given value. | ||
| val adjustedEarliestRound = |
There was a problem hiding this comment.
Some how I still feel that actual evidence of bootstrapping, ie round 0 is open, no verdicts ingested, etc is a better way to handle this.
Otherwise the correctness depends upon the state of DB.
There was a problem hiding this comment.
Understood; though the upside of depending on that state of the db is that it's unaffected by unexpected errors that might interfere with the other evidence
|
|
||
| "assertCompleteActivity" should { | ||
|
|
||
| "on first SV" should { |
There was a problem hiding this comment.
Lets cover scenario where first SV does meta-version bump
dfordivam
left a comment
There was a problem hiding this comment.
Lets get more review from Robert.
There was a problem hiding this comment.
Lets change the assertion here also
There was a problem hiding this comment.
fix assertion, confirm all contracts for rounds < 11 are gone
There was a problem hiding this comment.
Fixed, but only on reverting the environment back 1SV
With the 4SV environment, the contracts did not get archived; an quick investigation was because the non-first-SV scans could not serve root hashes for the early rounds
|
|
||
| override def environmentDefinition: SpliceEnvironmentDefinition = | ||
| EnvironmentDefinition | ||
| .simpleTopology1SvWithSimTime(this.getClass.getSimpleName) |
There was a problem hiding this comment.
Lets use simpleTopology4SvsWithSimTime now, as we no longer need the actAs = Seq(dsoParty block
There was a problem hiding this comment.
Implemented then reverted this because it caused one of the changed assertions to fail, as explained above.
Another assumption worth mentioning, the networks which are not bootstrapping must already have meta-table row, when this change lands. |
2f724e4 to
eb03441
Compare
|
|
||
| final case class InitialRewardConfig( | ||
| mintingVersion: String = "RewardVersion_FeaturedAppMarkers", | ||
| mintingVersion: String = "RewardVersion_TrafficBasedAppRewards", |
There was a problem hiding this comment.
I doubt that this is actually doing anything.
Notice initialRewardConfig: Option[InitialRewardConfig] = None,
So lets make sure we test actually turning the rewardConfig ON
…A is enabled Signed-off-by: Tim Emiola <adetokunbo@emio.la>
…on test Signed-off-by: Tim Emiola <adetokunbo@emio.la>
Signed-off-by: Tim Emiola <adetokunbo@emio.la>
Also: - improve test descriptions Signed-off-by: Tim Emiola <adetokunbo@emio.la>
Signed-off-by: Tim Emiola <adetokunbo@emio.la>
…e as a test Signed-off-by: Tim Emiola <adetokunbo@emio.la>
Signed-off-by: Tim Emiola <adetokunbo@emio.la>
Signed-off-by: Tim Emiola <adetokunbo@emio.la>
Signed-off-by: Tim Emiola <adetokunbo@emio.la>
eb03441 to
5982308
Compare
Fixes #5624
Assumes the following to detect bootstrapping:
Pull Request Checklist
Cluster Testing
/cluster_teston this PR to request it, and ping someone with access to the DA-internal system to approve it./hdm_teston this PR to request it, and ping someone with access to the DA-internal system to approve it./lsu_teston this PR to request it, and ping someone with access to the DA-internal system to approve it.PR Guidelines
Fixes #n, and mention issues worked on using#nMerge Guidelines