btcrelay
btcrelay copied to clipboard
High gas costs
It costs about 0.04$ to add a new header in gas costs. This makes it expensive to get it current (about 10k blocks behind)- any ideas to optimize to make it easier to keep up to date?
Thanks
You're right, adding a header (80bytes and logic) has been 160-200K gas, which can be 0.004 ETH.
An available idea now that might save a little is this API for bulk inserts: https://github.com/ethereum/btcrelay#bulkstoreheaderbytesofheaders-numberofheaders https://github.com/ethereum/btcrelay/blob/develop/btcBulkStoreHeaders.se#L6
A number of optimizations has been implemented in the code, and any other suggestions are welcome. Thanks