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

Querying account related information using custom querier in auth module #3761

Closed
4 tasks
ironman0x7b2 opened this issue Feb 28, 2019 · 2 comments
Closed
4 tasks

Comments

@ironman0x7b2
Copy link
Contributor

Summary of Bug

Hi,

Querying an account related information from auth store using CLIcontext queryStore method, immediately after making any transaction that modifies the account contents is giving old data even after the transaction gets committed in the block.

ironman@JARVIS:~/go/src/github.com/cosmos/cosmos-sdk$ gaiacli query account cosmos1fyj63h85syh8zhs90lutys946pt223n5g0e7sq --chain-id gaia; echo qwerty123 | gaiacli tx send cosmos1vmgwm6ptl4zhpjh2dcthawcdwg9dlw4l8d9d4c 1000stake --from genesis --chain-id gaia; gaiacli query account cosmos1fyj63h85syh8zhs90lutys946pt223n5g0e7sq --chain-id gaia;
Account:
  Address:       cosmos1fyj63h85syh8zhs90lutys946pt223n5g0e7sq
  Pubkey:        cosmospub1addwnpepqf5cqu65slfuwj0wk03fsj427cj25svyq7ftx5534985f6t8u49tyzr5qew
  Coins:         900000000stake
  AccountNumber: 0
  Sequence:      1
Response:
  Height: 24
  TxHash: 2F446EEA76B40753C00ABD83CE8DB6B3ADD898FDA08F57D155D21CE98E781D23
  Log: [{"msg_index":"0","success":true,"log":""}]
  GasWanted: 200000
  GasUsed: 25290
  Tags: 
    - action = send
    - sender = cosmos1fyj63h85syh8zhs90lutys946pt223n5g0e7sq
    - recipient = cosmos1vmgwm6ptl4zhpjh2dcthawcdwg9dlw4l8d9d4c
Account:
  Address:       cosmos1fyj63h85syh8zhs90lutys946pt223n5g0e7sq
  Pubkey:        cosmospub1addwnpepqf5cqu65slfuwj0wk03fsj427cj25svyq7ftx5534985f6t8u49tyzr5qew
  Coins:         900000000stake
  AccountNumber: 0
  Sequence:      1
ironman@JARVIS:~/go/src/github.com/cosmos/cosmos-sdk$ 

But if we wait for more 5-6 seconds (until one more block gets committed) and make a query, it's giving updated data.

ironman@JARVIS:~/go/src/github.com/cosmos/cosmos-sdk$ gaiacli query account cosmos1fyj63h85syh8zhs90lutys946pt223n5g0e7sq --chain-id gaia; echo qwerty123 | gaiacli tx send cosmos1vmgwm6ptl4zhpjh2dcthawcdwg9dlw4l8d9d4c 1000stake --from genesis --chain-id gaia; sleep 6; gaiacli query account cosmos1fyj63h85syh8zhs90lutys946pt223n5g0e7sq --chain-id gaia;
Account:
  Address:       cosmos1fyj63h85syh8zhs90lutys946pt223n5g0e7sq
  Pubkey:        cosmospub1addwnpepqf5cqu65slfuwj0wk03fsj427cj25svyq7ftx5534985f6t8u49tyzr5qew
  Coins:         899999000stake
  AccountNumber: 0
  Sequence:      2
Response:
  Height: 49
  TxHash: 98D71DF2F258F643963F3862C565996B7B1D52574AC3BB3E3CBDB91E098C7202
  Log: [{"msg_index":"0","success":true,"log":""}]
  GasWanted: 200000
  GasUsed: 22482
  Tags: 
    - action = send
    - sender = cosmos1fyj63h85syh8zhs90lutys946pt223n5g0e7sq
    - recipient = cosmos1vmgwm6ptl4zhpjh2dcthawcdwg9dlw4l8d9d4c
Account:
  Address:       cosmos1fyj63h85syh8zhs90lutys946pt223n5g0e7sq
  Pubkey:        cosmospub1addwnpepqf5cqu65slfuwj0wk03fsj427cj25svyq7ftx5534985f6t8u49tyzr5qew
  Coins:         899998000stake
  AccountNumber: 0
  Sequence:      3
ironman@JARVIS:~/go/src/github.com/cosmos/cosmos-sdk$ 

We used to have the same issue with another store ('XYZ'), but after adding a custom querier like in staking module we are able to get the updated results immediately.
I hope the Cosmos team will add a custom querier for auth module as well.

Steps to Reproduce


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@jackzampolin
Copy link
Member

@ironman0x7b2 We do accept PRs! Can you push the custom querier you have in a PR?

@ironman0x7b2
Copy link
Contributor Author

@jackzampolin Done!

Please check PR: #3767

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

No branches or pull requests

2 participants