-
Notifications
You must be signed in to change notification settings - Fork 696
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
[pallet-revive] use evm decimals in call host fn #6466
Conversation
/cmd prdoc --audience runtime_dev --bump minor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My expertise is limited but with that I don't see anything obnoxious...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't we do the conversion inside the checked extrinsic conversion before? I would expect that code to be touched here, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are those versioned by accident? Same for the other build outputs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by versioned?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meaning: Why are we checking in compilation outputs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are used to run tests e.g https://github.com/paritytech/polkadot-sdk/blob/pg/piggy-bank/substrate/frame/revive/rpc/src/tests.rs?plain=1#L243-L260
they were already checked in, except they were part of the json file, this approach works better for tooling like chaintypes that generates the ts types from the abi files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if we make breaking changes to pallet_revive we need to wait for a new revive version and then rebuild those files? Because there are CI tests that use them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you suggesting, that we only build test cases in Rust?
Would be pretty bad if we were breaking people's tooling and they could not submit a contract on chain anymore ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can those not be vendored?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you mean exactly, there is a js build script that can regenerate these blobs
substrate/frame/revive/rpc/examples/js/src/build-contracts.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then we shouldn't put them in git?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well they are mostly here to play with js code
but I also use them to run integration tests rpc tests in CI
I don't want to add the revive tooling to the mono repo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok no hard opinion, I just find vendored code blobs always annoying because they have to get updated manually (in this case with breaking PVM or pallet changes
Do we have information about native and EVM balances, as well as their conversion, in our tutorial? I assume that when we use the Substrate tools, we will see the native balance, and when we use the Ethereum tools, we will see the EVM balance. |
good call, so these number should be the same. |
Just to confirm, I can use the pallet-balances to check the account balance, or I can look into the block explorer. Will it match what I see in MetaMask? |
All ui should display the same value |
Review required! Latest push from author must always be reviewed |
This PR update the pallet to use the EVM 18 decimal balance in contracts call and host functions instead of the native balance.
It also updates the js example to add the piggy-bank solidity contract that expose the problem