Skip to content

Commit

Permalink
Ema the scores 2 (#560)
Browse files Browse the repository at this point in the history
<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺
v           ✰  Thanks for creating a PR! You're awesome! ✰
v Please note that maintainers will only review those PRs with a
completed PR template.
☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  -->

## Purpose of Changes and their Description

## Link(s) to Ticket(s) or Issue(s) resolved by this PR

## Are these changes tested and documented?

- [ ] If tested, please describe how. If not, why tests are not needed.
- [ ] If documented, please describe where. If not, describe why docs
are not needed.
- [ ] Added to `Unreleased` section of `CHANGELOG.md`?

## Still Left Todo

*Fill this out if this is a Draft PR so others can help.*

---------

Co-authored-by: Tyler <[email protected]>
  • Loading branch information
kpeluso and relyt29 authored Aug 30, 2024
1 parent ba7236c commit e602dac
Show file tree
Hide file tree
Showing 41 changed files with 5,118 additions and 3,618 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Implements fixes for our [June 2024](https://github.com/sherlock-audit/2024-06-a
### Added

* [#542](https://github.com/allora-network/allora-chain/pull/542) Add scalable management of active topics with associated queries such as `GetActiveTopicsAtBlock` and `GetNextChurningBlockByTopicId`
* [#556](https://github.com/allora-network/allora-chain/pull/556) Scores now take an exponential moving average of the score rather than using the instantaneous score value from this epoch.

### Removed

Expand Down
24 changes: 14 additions & 10 deletions test/integration/create_topic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,20 @@ func CreateTopic(m testCommon.TestConfig) (topicId uint64) {
require.Positive(m.T, topicIdStart.NextTopicId)
require.NoError(m.T, err)
createTopicRequest := &emissionstypes.MsgCreateNewTopic{
Creator: m.AliceAddr,
Metadata: "ETH 24h Prediction",
LossMethod: "mse",
EpochLength: 5,
GroundTruthLag: 10,
WorkerSubmissionWindow: 4,
PNorm: alloraMath.NewDecFromInt64(3),
AlphaRegret: alloraMath.MustNewDecFromString("0.1"),
AllowNegative: true,
Epsilon: alloraMath.MustNewDecFromString("0.01"),
Creator: m.AliceAddr,
Metadata: "ETH 24h Prediction",
LossMethod: "mse",
EpochLength: 5,
GroundTruthLag: 10,
WorkerSubmissionWindow: 4,
PNorm: alloraMath.NewDecFromInt64(3),
AlphaRegret: alloraMath.MustNewDecFromString("0.1"),
AllowNegative: true,
Epsilon: alloraMath.MustNewDecFromString("0.01"),
MeritSortitionAlpha: alloraMath.MustNewDecFromString("0.1"),
ActiveInfererQuantile: alloraMath.MustNewDecFromString("0.2"),
ActiveForecasterQuantile: alloraMath.MustNewDecFromString("0.2"),
ActiveReputerQuantile: alloraMath.MustNewDecFromString("0.2"),
}
txResp, err := m.Client.BroadcastTx(ctx, m.AliceAcc, createTopicRequest)
require.NoError(m.T, err)
Expand Down
24 changes: 14 additions & 10 deletions test/invariant/topics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,20 @@ func createTopic(
wasErr := false
iterLog(m.T, iteration, actor, "creating new topic")
createTopicRequest := &emissionstypes.MsgCreateNewTopic{
Creator: actor.addr,
Metadata: fmt.Sprintf("Created topic iteration %d", iteration),
LossMethod: "mse",
EpochLength: data.epochLength,
GroundTruthLag: data.epochLength,
WorkerSubmissionWindow: 10,
PNorm: alloraMath.NewDecFromInt64(3),
AlphaRegret: alloraMath.MustNewDecFromString("0.1"),
AllowNegative: true,
Epsilon: alloraMath.MustNewDecFromString("0.01"),
Creator: actor.addr,
Metadata: fmt.Sprintf("Created topic iteration %d", iteration),
LossMethod: "mse",
EpochLength: data.epochLength,
GroundTruthLag: data.epochLength,
WorkerSubmissionWindow: 10,
PNorm: alloraMath.NewDecFromInt64(3),
AlphaRegret: alloraMath.MustNewDecFromString("0.1"),
AllowNegative: true,
Epsilon: alloraMath.MustNewDecFromString("0.01"),
MeritSortitionAlpha: alloraMath.MustNewDecFromString("0.1"),
ActiveInfererQuantile: alloraMath.MustNewDecFromString("0.2"),
ActiveForecasterQuantile: alloraMath.MustNewDecFromString("0.2"),
ActiveReputerQuantile: alloraMath.MustNewDecFromString("0.2"),
}

ctx := context.Background()
Expand Down
24 changes: 14 additions & 10 deletions test/stress/create_topic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,20 @@ func createTopic(
) (topicId uint64) {
ctx := context.Background()
createTopicRequest := &emissionstypes.MsgCreateNewTopic{
Creator: creator.aa.addr,
Metadata: "ETH 24h Prediction",
LossMethod: "mse",
EpochLength: epochLength,
GroundTruthLag: epochLength,
WorkerSubmissionWindow: epochLength,
PNorm: alloraMath.NewDecFromInt64(3),
AlphaRegret: alloraMath.NewDecFromInt64(1),
AllowNegative: true,
Epsilon: alloraMath.MustNewDecFromString("0.01"),
Creator: creator.aa.addr,
Metadata: "ETH 24h Prediction",
LossMethod: "mse",
EpochLength: epochLength,
GroundTruthLag: epochLength,
WorkerSubmissionWindow: epochLength,
PNorm: alloraMath.NewDecFromInt64(3),
AlphaRegret: alloraMath.NewDecFromInt64(1),
AllowNegative: true,
Epsilon: alloraMath.MustNewDecFromString("0.01"),
MeritSortitionAlpha: alloraMath.MustNewDecFromString("0.1"),
ActiveInfererQuantile: alloraMath.MustNewDecFromString("0.2"),
ActiveForecasterQuantile: alloraMath.MustNewDecFromString("0.2"),
ActiveReputerQuantile: alloraMath.MustNewDecFromString("0.2"),
}

txResp, err := m.Client.BroadcastTx(ctx, creator.aa.acc, createTopicRequest)
Expand Down
Loading

0 comments on commit e602dac

Please sign in to comment.