Skip to content

Optimize topic weights fetch and update flow#794

Merged
guilherme-brandao merged 7 commits intodevfrom
optimizing-topic-weights-update
Apr 7, 2025
Merged

Optimize topic weights fetch and update flow#794
guilherme-brandao merged 7 commits intodevfrom
optimizing-topic-weights-update

Conversation

@guilherme-brandao
Copy link
Contributor

@guilherme-brandao guilherme-brandao commented Apr 4, 2025

Purpose of Changes and their Description

  • Remove repeated and unnecessary fetches for the module params and topic structure during the topic GetCurrentTopicWeight and DripTopicFeeRevenue

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

No ticket was created for this. This optimization opportunity was found during the execution of this ticket:
https://linear.app/alloralabs/issue/ENGN-3608/test-topic-weight-changes

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?

Copy link
Contributor

@xmariachi xmariachi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small change but otherwise lgtm

Copy link
Contributor

@amimart amimart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just small remarks I'll let up to you

@xmariachi
Copy link
Contributor

Needs fixing linter and compilation is failing in tests, otherwise it lgtm.

# github.com/allora-network/allora-chain/x/emissions/keeper_test [github.com/allora-network/allora-chain/x/emissions/keeper.test]
Error: x/emissions/keeper/keeper_test.go:4747:45: not enough arguments in call to k.DripTopicFeeRevenue
	have ("github.com/cosmos/cosmos-sdk/types".Context, uint64, int64)
	want ("github.com/cosmos/cosmos-sdk/types".Context, "github.com/allora-network/allora-chain/x/emissions/types".Topic, "github.com/allora-network/allora-chain/math".Dec, "github.com/allora-network/allora-chain/x/emissions/keeper".BlockHeight)
Error: x/emissions/keeper/keeper_test.go:4750:45: not enough arguments in call to k.DripTopicFeeRevenue
	have ("github.com/cosmos/cosmos-sdk/types".Context, uint64, int64)

@guilherme-brandao guilherme-brandao force-pushed the optimizing-topic-weights-update branch from 4aafc96 to 61d9bc3 Compare April 4, 2025 20:05
amimart
amimart previously approved these changes Apr 7, 2025
Copy link
Contributor

@xmariachi xmariachi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add to changelog, otherwise lgtm, good work

@guilherme-brandao guilherme-brandao merged commit 9bbe718 into dev Apr 7, 2025
9 checks passed
@guilherme-brandao guilherme-brandao deleted the optimizing-topic-weights-update branch April 7, 2025 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants