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

ALERT: Transaction Error. Exception thrown in contract code. #123

Open
maratP opened this issue Jan 26, 2021 · 6 comments
Open

ALERT: Transaction Error. Exception thrown in contract code. #123

maratP opened this issue Jan 26, 2021 · 6 comments

Comments

@maratP
Copy link

maratP commented Jan 26, 2021

Frontend (on our private network) works for both dapps (validators and voting), but when we try to submit transactions (to finalize metadata or create new ballot for voting), we get this error in Metamask:

ALERT: Transaction Error. Exception thrown in contract code.

P.S.
It used to work and we were able to set metadata for validator and also confirm it. Now, we can't finalize it and submit any transaction

Is is related to gas limit? Metamask changes? How do we fix or debug it? Also, what additional information do you need?

@maratP
Copy link
Author

maratP commented Jan 26, 2021

Update:

When I say "used to work and was able to confirm metadata" that was more than a year ago.. So it might be related to Metamask changes..

Also since these daps use legacy window.web3 API, installed additional Metamask extension according to this doc:
https://metamask.zendesk.com/hc/en-us/articles/360053147012

That didn't help. Could it be related to Gas limit?

Here is a snippet of the conctract.js

export default class Metadata {
  async init({ web3, netId, addresses }) {
    this.web3 = web3
    this.gasPrice = web3.utils.toWei('2', 'gwei') 

@varasev
Copy link
Contributor

varasev commented Jan 26, 2021

@maratP Could you please first try to make confirmPendingChange call on the page https://blockscout.com/poa/sokol/address/0xFFD6eEBda850E4a20b6d9C9e98Ee631f8d7cA950/write-proxy (for Sokol network) instead of UI? To make sure there are no issues in the ValidatorMetadata contract. Please, use your voting key to make the transaction.

The _miningKey parameter should be set to 0x4E20226355b4464Cf8f3b67Fc318b753A7c125B3 for the existing pending changes displayed in UI:

Does it work through Blockscout?

@varasev
Copy link
Contributor

varasev commented Jan 26, 2021

Frontend (on our private network) works for both dapps (validators and voting), but when we try to submit transactions (to finalize metadata or create new ballot for voting), we get this error in Metamask:...

You get this only in the local private network or both in local and production (Core/Sokol)?

Could it be related to Gas limit?

Yes. Please, try to set larger gas limit in MetaMask when sending transaction.

Also, it's worth to try to set gas price to 20 gwei.

Also since these daps use legacy window.web3 API

The dapps don't use window.web3 anymore. The main code uses window.ethereum:

if (window.ethereum) {
web3 = new Web3(window.ethereum)
console.log('Injected web3 detected.')
if (!window.ethereum.autoRefreshOnNetworkChange) {
window.ethereum.on('chainChanged', () => {
window.location.reload()
})
}

But it still supports legacy MetaMask with window.web3.

@varasev
Copy link
Contributor

varasev commented Jan 26, 2021

If the error still persists with MetaMask (after trying larger gasLimit and gasPrice), please attach here the screenshot of the alert.

@maratP
Copy link
Author

maratP commented Feb 4, 2021

Thank you! I will try to set larger gas limit in MetaMask and let you know.

P.S.
I don't think I'll be able to try it on Sokol since I am not a validator on POA for quite some tine now. However on our private network, it says that I already confirmed this change. But that was more than a year ago so might be related to gas limit or other external tools changes. Will update here.

Thanks again

@DavidFFFFFFFFF
Copy link

same happening to me

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

3 participants