btcrelay icon indicating copy to clipboard operation
btcrelay copied to clipboard

High gas costs

Open bamos01 opened this issue 8 years ago • 1 comments

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

bamos01 avatar Dec 10 '16 01:12 bamos01

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

ethers avatar Dec 10 '16 02:12 ethers