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

bug(evm): de-synchronization between wasm bank balance and EVM account state #2133

Closed
k-yang opened this issue Dec 28, 2024 · 1 comment · Fixed by #2134
Closed

bug(evm): de-synchronization between wasm bank balance and EVM account state #2133

k-yang opened this issue Dec 28, 2024 · 1 comment · Fixed by #2134
Assignees
Labels
x: evm Relates to Nibiru EVM or the EVM Module

Comments

@k-yang
Copy link
Member

k-yang commented Dec 28, 2024

Description

Transfer between regular base account and an account made from a Wasm contract

Steps to Reproduce

  1. bank send funds to a wasm account
nibid tx bank send \
nibi1zaavvzxez0elundtn32qnk9lkm8kmcsz44g7xl \
nibi14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9ssa9gcs \
1000000unibi \
--gas auto \
--gas-adjustment 1.5 \
--gas-prices 0.025unibi \
--yes | jq
  1. query bank balances
nibid q bank balances nibi14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9ssa9gcs | jq
{
  "balances": [
    {
      "denom": "unibi",
      "amount": "1000000"
    }
  ],
  "pagination": {
    "next_key": null,
    "total": "0"
  }
}
  1. query evm account
nibid q evm account nibi14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9ssa9gcs | jq
{
  "balance": "0",
  "balance_wei": "0",
  "code_hash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
  "nonce": "0",
  "eth_address": "0x5A8D648DEE57b2fc90D98DC17fa887159b69638b",
  "bech32_address": "nibi14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9ssa9gcs"
}

The EVM account should have the same balance as the bank balance.

@github-project-automation github-project-automation bot moved this to ⚡ Building 🧱 in ⚛️ Nibiru (Hougyoku) Dec 28, 2024
@k-yang k-yang added the x: evm Relates to Nibiru EVM or the EVM Module label Dec 28, 2024
@github-actions github-actions bot added the S-triage Status: This issue is waiting on initial triage. More Info: https://tinyurl.com/25uty9w5 label Dec 28, 2024
@k-yang k-yang self-assigned this Dec 28, 2024
@Unique-Divine Unique-Divine removed the S-triage Status: This issue is waiting on initial triage. More Info: https://tinyurl.com/25uty9w5 label Dec 30, 2024
@Unique-Divine
Copy link
Member

Note that this is not related to any difference of actual funds. The GRPC query is simply retrieving the balance incorrectly by using StateDB.GetAccount instead of the bank balance query.

Easy fix here: #2134

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x: evm Relates to Nibiru EVM or the EVM Module
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants
@k-yang @Unique-Divine and others