Somehow I am getting insanely high gas costs compared to what I think I should be seeing.
I have a function in solidity:
function setMessage(uint8[] _fMessage) public returns (uint256){
emit Message(_fMessage);
}
And my event:
event Message(uint8[] message);
When I call it using this: EthProj.setMessage.sendTransaction([72, 193, 77], {from: my address})
where EthProj is my contract, this is using up 25027 gas.
When I run eth.getTransactionReceipt
with the transactionHash
of my transaction it says: gasUsed: 25027
.
According to this: https://github.com/djrtwo/evm-opcode-gas-costs/blob/master/opcode-gas-costs_EIP-150_revision-1e18248_2017-04-12.csv
, more specificially this part: LOG0 375 + 8 * (number of bytes in log data)
it should only cost about 400 gas as there are only 3 bytes in the event.
Where is this massive cost coming from?