Skip to content

Use slice based loop instead of map based loop in Begin/EndBlock#33

Merged
codchen merged 2 commits intomasterfrom
tony-chen-remove-map-loop
Jun 6, 2022
Merged

Use slice based loop instead of map based loop in Begin/EndBlock#33
codchen merged 2 commits intomasterfrom
tony-chen-remove-map-loop

Conversation

@codchen
Copy link
Collaborator

@codchen codchen commented Jun 5, 2022

Instead of looping over a map, we will fetch a slice of registered pairs first, and then iterate over the slice and get map's value keyed by each pair, so that the iteration is deterministic.

@codchen codchen requested review from LCyson and philipsu522 June 5, 2022 18:48
Copy link
Contributor

@LCyson LCyson left a comment

Choose a reason for hiding this comment

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

lgtm, can we add some test sets to dex endBlock so that if there is any non-determinism in the future the CI will fail

@codchen codchen force-pushed the tony-chen-remove-map-loop branch from 3cb79a6 to dece160 Compare June 6, 2022 00:15
@codchen
Copy link
Collaborator Author

codchen commented Jun 6, 2022

@LCyson added a test for idempotency

@codchen codchen merged commit 0e313eb into master Jun 6, 2022
masih pushed a commit that referenced this pull request Sep 26, 2025
Replace cosmos/tendermint/iavl/tmdb/ibc dependencies with forked versions
masih pushed a commit that referenced this pull request Sep 29, 2025
Adding a handler for handling gov proposals from CLI in order to update
the dependency mappings for access control module. Will follow up with
another PR to handle deletes

### Testing 
Ran these commands and see that the dep mapping updated
```
seid tx staking delegate seivaloper1r9syjw4kdpjr8a6v38qmvn4dmmrnl869kmgsvr 59999000001341816640usei --from brando --chain-id sei-chain -b block -y --fees 2000usei

seid tx gov submit-proposal update-resource-dependency-mapping ../brando/acl-gov.json --from brando  --fees=10000000usei --gas=5000000  --chain-id sei-chain  -b block

seid tx gov deposit 1 10000000usei --chain-id sei-chain --from brando --fees=10000000usei --gas=5000000 -b block -y

seid tx gov vote 1 yes --chain-id sei-chain --from brando -b block -y --fees=10000000usei
``` 


![image](https://user-images.githubusercontent.com/18161326/193750113-35b13a6d-d1a5-45e8-a15b-256cd2584ff7.png)
masih pushed a commit that referenced this pull request Sep 30, 2025
Adding a handler for handling gov proposals from CLI in order to update
the dependency mappings for access control module. Will follow up with
another PR to handle deletes

### Testing 
Ran these commands and see that the dep mapping updated
```
seid tx staking delegate seivaloper1r9syjw4kdpjr8a6v38qmvn4dmmrnl869kmgsvr 59999000001341816640usei --from brando --chain-id sei-chain -b block -y --fees 2000usei

seid tx gov submit-proposal update-resource-dependency-mapping ../brando/acl-gov.json --from brando  --fees=10000000usei --gas=5000000  --chain-id sei-chain  -b block

seid tx gov deposit 1 10000000usei --chain-id sei-chain --from brando --fees=10000000usei --gas=5000000 -b block -y

seid tx gov vote 1 yes --chain-id sei-chain --from brando -b block -y --fees=10000000usei
``` 


![image](https://user-images.githubusercontent.com/18161326/193750113-35b13a6d-d1a5-45e8-a15b-256cd2584ff7.png)
masih pushed a commit that referenced this pull request Oct 9, 2025
Perf: Improve memIAVL import speed by 2X
@masih masih deleted the tony-chen-remove-map-loop branch October 31, 2025 15:53
masih pushed a commit that referenced this pull request Dec 17, 2025
Synchronize potential concurrent access to mutable tree
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.

2 participants