-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate events and transactions as leafs of Merkle Tree #4
Comments
Now that the proof creation uses a common set of code, it should be possible to modify the underlying code without having to modify the on-chain or client-side code. Having the Either the However, these are only needed to construct the |
It seems that the account nonce can't be retrieved from the transaction receipt, the following fields are in the transaction receipt:
I think the For logs, the following is an example of a log item: [
{
"address": "0x9561c133dd8580860b6b7e504bc5aa500f0f06a7",
"blockHash": "0x3a10ed208587bfad56e7833e9e1e58efb8a0d7df6c640039c30d895084af419f",
"blockNumber": "0x19",
"data": "0x6a6eec830ff29aadc4fea95a94b653075d65777c3f06c625229eca9f07befaf4000000000000000000000000000000000000000000000000000000000000000c",
"logIndex": "0x0",
"topics": [
"0x2cbdbe00cebef89186c967208065ecaafca1aa8a8971c4ccaa8ac017a9cad9ae"
],
"transactionHash": "0x56a163311d8ed6edcf0fc02eb349a1e81421c75d4cc14b0284cf2b823ec0c409",
"transactionIndex": "0x0",
"type": "mined"
}
] Is it safe to assume that So, Then the leaf hash provided to
Or the Additionally, if the same data from the same transaction index and log index are included in two blocks, which contains only that transaction, then the merkle proof will be valid across two blocks. For this reason the block height must be included to fix the merkle proof to a specific block height.
The So, after reducing In the go-ethereum source blockHeight is uint64 too: The transaction index and log index fields are 32bits:
The current Additionally the network ID field needs including in the leaf hash.
This shouldn't require any modifications to |
While running the Lithium daemon with some of the tests I noticed a problem, the merkle root was the same for different blocks because it contains only a single transaction where the leaf parameters are the same.
Currently the leaf for transactions consists of:
Currently the leaf for events consists of:
By adding the account nonce to the transaction leaf, and the log index, and possibly the transaction hash, to the event leaf then these will be globally unique, in addition to being unique per block.
See output of the command example
python3 -mpanautomata lithium --account 0xffcf8fdee72ac11b5c542428b35eef5769c409f0 --rpc-from 127.0.0.1:8545 --rpc-to 127.0.0.1:8546 --contract 0xcfeb869f69431e42cdb54a4f4f105c19c080a601 --pid .lithium.a2b.pid
:The new parameters for the merkle tree leafs would be:
Transactions:
Events:
The text was updated successfully, but these errors were encountered: