Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: accaddr cachefix (backport #15433) #16823

Merged
merged 2 commits into from
Jul 5, 2023

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jul 4, 2023

I have a different case for this feature than the originally intended, in memiavl we are experimenting with zero-copy feature, where we return slices pointing to mmap-ed region to app directly, which means app must not retain the slices beyond next Commit event, because the region could be unmapped there when certain events happened. There are a few places in sdk that breaks this assumption:

  • inter-block cache, this can be easily disabled, the functionalities is duplicated with memiavl internal cache or iavl's fast node cache anyway.
  • the address cache, either we disable the cache at all, or we make it copy the byte slices before set to cache.
    • I've run the benchmark BenchmarkOneBankSendTxPerBlock with/without the cache, the difference is relatively small (time: +2.62%, alloc: +1.23%), that's when the cache is hit perfectly, in real world we have much more varieties in addresses.
      So I figure we can simply disable the cache, so we can enable the memiavl zero-copy feature.

is there other places that breaks the zero-copy assumption that I'm not aware of?

This is an automatic backport of pull request #15433 done by Mergify.
Cherry-pick of cdf6471 has failed:

On branch mergify/bp/release/v0.46.x/pr-15433
Your branch is up to date with 'origin/release/v0.46.x'.

You are currently cherry-picking commit cdf6471e5.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   types/address.go
	modified:   types/address_test.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   CHANGELOG.md

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

Co-authored-by: Julien Robert <julien@rbrt.fr>
Co-authored-by: Marko <marbar3778@yahoo.com>
(cherry picked from commit cdf6471)

# Conflicts:
#	CHANGELOG.md
@mergify mergify bot requested a review from a team as a code owner July 4, 2023 09:16
@mergify mergify bot added the conflicts label Jul 4, 2023
@yihuang yihuang removed the conflicts label Jul 4, 2023
Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

utACK. Summary makes sense to me, thanks @yihuang

@julienrbrt julienrbrt merged commit b39cdb2 into release/v0.46.x Jul 5, 2023
40 checks passed
@julienrbrt julienrbrt deleted the mergify/bp/release/v0.46.x/pr-15433 branch July 5, 2023 08:32
GAtom22 pushed a commit to evmos/cosmos-sdk that referenced this pull request Jul 12, 2023
Co-authored-by: KyleMoser <KyleMoser@users.noreply.github.com>
Co-authored-by: HuangYi <huang@crypto.com>
GAtom22 pushed a commit to evmos/cosmos-sdk that referenced this pull request Jul 12, 2023
Co-authored-by: KyleMoser <KyleMoser@users.noreply.github.com>
Co-authored-by: HuangYi <huang@crypto.com>
cmwaters added a commit to celestiaorg/cosmos-sdk that referenced this pull request Aug 15, 2023
* build(deps): bump cometbft to v0.34.29 (cosmos#16553)

* fix(x/auth): ensure nil .BaseAccounts are reported in ModuleAccount.Validate (backport cosmos#16554) (cosmos#16570)

Co-authored-by: Emmanuel T Odeke <emmanuel@orijtech.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>

* fix: snapshotter's failure is not propogated (backport cosmos#16588) (cosmos#16604)

Co-authored-by: yihuang <huang@crypto.com>

* feat: add custom max gas for block for sim config (backport cosmos#16656) (cosmos#16731)

Co-authored-by: mmsqe <mavis@crypto.com>
Co-authored-by: marbar3778 <marbar3778@yahoo.com>

* fix: accaddr cachefix (backport cosmos#15433) (cosmos#16823)

Co-authored-by: KyleMoser <KyleMoser@users.noreply.github.com>
Co-authored-by: HuangYi <huang@crypto.com>

* fix(cli): improve `prune` command ux (backport cosmos#16856) (cosmos#16876)

Co-authored-by: Julien Robert <julien@rbrt.fr>

* fix: query tx events with `>=` and `<=` operators (cosmos#16994)

* docs: change bank multi-send command description (backport cosmos#16950) (cosmos#17019)

* chore: prepare v0.46.14 (cosmos#16879)

* refactor: add MigrateHandler to allow reuse migrate genesis related function  (backport cosmos#17296) (cosmos#17301)

Co-authored-by: mmsqe <mavis@crypto.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>

* fix: resolve migration map in MigrateHandler (cosmos#17301) (cosmos#17302)

* feat(x/gov): Emit VoterAddr (backport cosmos#17354) (cosmos#17357)

Co-authored-by: Devon Bear <itsdevbear@berachain.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>

* feat(x/gov): add MsgSubmitProposal SetMsgs method (backport cosmos#17387) (cosmos#17388)

Co-authored-by: Julien Robert <julien@rbrt.fr>

---------

Co-authored-by: Julien Robert <julien@rbrt.fr>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Emmanuel T Odeke <emmanuel@orijtech.com>
Co-authored-by: yihuang <huang@crypto.com>
Co-authored-by: mmsqe <mavis@crypto.com>
Co-authored-by: marbar3778 <marbar3778@yahoo.com>
Co-authored-by: KyleMoser <KyleMoser@users.noreply.github.com>
Co-authored-by: Rootul P <rootulp@gmail.com>
Co-authored-by: Devon Bear <itsdevbear@berachain.com>
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.

4 participants