Hi! I use nethereum (C# lib) to register a transaction in Poa Network.
Some records, go OK, but some without a defined pattern, return HASH without any error to me but the record does not exist.
for example: https://blockscout.com/poa/core/search?q=0x7c4da348f1de25d73ac3cb9aa1f6888855f4fcc885553d604b7ea77c3c085130 (404 Page Not Found)
Can you help me try to at least find the way?
Hugs!
Hi, could you provide a piece of code how do you broadcast a transaction to POA chain with Nethereum?
Hi Viktor!
Follow my code…
Doing some tests, it is happening when I send a batch of many records at the same time, the transactions are synchronous, but it takes less than 1 second to execute. Then after a while he starts to give the problem.
var abi = (new WebClient()).DownloadString(System.Configuration.ConfigurationManager.AppSettings["BlockChainContractSchemaUrl"]);
var url = System.Configuration.ConfigurationManager.AppSettings["UrlNetWork"];
KeyVault vault = new KeyVault();
var privateKey = "";
if (Key == null || Key == "")
{
privateKey = vault.GetSecret("SenderAddressPrivateKey");
}
else
{
privateKey = Key;
}
var account = new Account(privateKey);
var web3 = new Web3(account, url);
var contractAddress = System.Configuration.ConfigurationManager.AppSettings["ContractAddress"];
var senderAddress = System.Configuration.ConfigurationManager.AppSettings["SenderAddress"];
var _set = new SetValue()
{
dataValue = Message
};
var contract = web3.Eth.GetContract(abi, contractAddress);
var SetFunction = contract.GetFunction("set");
byte[] ba = Encoding.Default.GetBytes(Message);
double lenght = 8000000;
var transactionHash = await SetFunction.SendTransactionAsync(senderAddress, new HexBigInteger(Convert.ToInt64(lenght)), new HexBigInteger(Convert.ToInt64(System.Configuration.ConfigurationManager.AppSettings["WeiGasPrice"])), new HexBigInteger(0), Message);
What is the gas price setting System.Configuration.ConfigurationManager.AppSettings["WeiGasPrice"])
? Take into account that some validators increased the gas price recently on POA Core network https://forum.poa.network/t/increase-gas-price-from-1-gwei-to-5-gwei-to-mitigate-ongoing-resource-wasting-attack/3232
@Marcelo_Fernandes could you try sending txs asynchronously?
Hi Viktor,
The problem for sure is the fact that you send many transactions in a row at the same contract or address of origin.
I added a 30 second delay to each transaction… a day has passed and the problem has not happened anymore.
Is this a real fact? Does the network have any detection to understand that it could be an attack, for example?