Description
Uploading a KYC document through the Apothem Masternode dashboard fails when the user is logged in using the Private Key/Mnemonic provider.
The RPC rejects the transaction with the following error:
only replay-protected (EIP-155) transactions allowed over RPC
Environment
Steps to reproduce
- Open https://master.apothem.network/.
- Log in using Private Key/Mnemonic with a funded owner account.
- Click Become a candidate.
- Select a valid PDF KYC document.
- Click Upload KYC.
- Observe the error notification.
Actual result
The dashboard displays:
An error occurred while uploading KYC. only replay-protected (EIP-155) transactions allowed over RPC
The RPC rejects the uploadKYC transaction and no KYC record is written to the validator contract.
Expected result
The dashboard should sign and submit an EIP-155 replay-protected transaction for Apothem chain ID 51, and display the resulting transaction hash or successful KYC status.
Technical analysis
The current uploadKYC implementation constructs the transaction parameters without a chainId:
const txParams = {
from: account,
gasPrice: self.web3.utils.toHex(self.gasPrice),
gas: self.web3.utils.toHex(gas)
}
Source:
|
const txParams = { |
|
from: account, |
|
gasPrice: self.web3.utils.toHex(self.gasPrice), |
|
gas: self.web3.utils.toHex(gas) |
|
} |
The Private Key/Mnemonic provider therefore appears to sign a legacy, non-EIP-155 transaction. Apothem RPC rejects such transactions.
The propose flow in the same component already includes:
chainId: self.chainConfig.networkId
Suggested fix
Include the configured network chain ID in the uploadKYC transaction:
const txParams = {
from: account,
gasPrice: self.web3.utils.toHex(self.gasPrice),
gas: self.web3.utils.toHex(gas),
chainId: self.chainConfig.networkId
}
It would also be useful to add regression tests for both Private Key and Mnemonic login providers on Apothem.
Additional note
PR #60 was intended to resolve KYC upload with a private key, but the current transaction parameters still do not contain chainId:
#60
Description
Uploading a KYC document through the Apothem Masternode dashboard fails when the user is logged in using the Private Key/Mnemonic provider.
The RPC rejects the transaction with the following error:
Environment
Steps to reproduce
Actual result
The dashboard displays:
The RPC rejects the
uploadKYCtransaction and no KYC record is written to the validator contract.Expected result
The dashboard should sign and submit an EIP-155 replay-protected transaction for Apothem chain ID
51, and display the resulting transaction hash or successful KYC status.Technical analysis
The current
uploadKYCimplementation constructs the transaction parameters without achainId:Source:
MasterNode-App/app/components/candidates/Apply.vue
Lines 709 to 713 in fc925b1
The Private Key/Mnemonic provider therefore appears to sign a legacy, non-EIP-155 transaction. Apothem RPC rejects such transactions.
The
proposeflow in the same component already includes:Suggested fix
Include the configured network chain ID in the
uploadKYCtransaction:It would also be useful to add regression tests for both Private Key and Mnemonic login providers on Apothem.
Additional note
PR #60 was intended to resolve KYC upload with a private key, but the current transaction parameters still do not contain
chainId:#60