-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Not adding blob sidecar for EIP-4844 transaction when encoding for signing #2196
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reference, here's some relevant Besu classes:
https://github.com/hyperledger/besu/blob/main/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/EncodingContext.java
BLOCK_BODY context uses https://github.com/hyperledger/besu/blob/main/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/BlobTransactionEncoder.java
POOLED_TRANSACTION context uses
https://github.com/hyperledger/besu/blob/main/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/BlobPooledTransactionEncoder.java
Besu doesn't have to worry about unsigned transactions though.
|
||
return result; | ||
return result; | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two RLP representations of a 4844 transaction: one for block body (without sidecar) and one "pooled transaction" for txpool/networking (with sidecar): https://eips.ethereum.org/EIPS/eip-4844#networking
I don't have enough context to know if switching on the presence of a signature is appropriate for that difference. Is it possible a client may want to pass in a signature for a pooled transaction?
Perhaps this class needs to expose the two possible RLP representations to the clients since maybe only the clients will have the appropriate context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point — I'm not sure about the signature of the pooled transaction. What I have verified is the signing of the block body, using this signature for the pooled transaction when passing it to Geth. With this signature, the signer of the pooled transaction was decoded correctly and the transaction was accepted. However, when the whole pooled transaction was signed, the signer was decoded incorrectly. It looked like sending from different address than I did.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when the whole pooled transaction was signed, the signer was decoded incorrectly.
That's a little surprising to me given what I was reading yesterday, I would have guessed your context was block body. But I'm not very close to this code so just wanted to highlight the two possible contexts.
1be2853
to
d4bec2a
Compare
…gning Signed-off-by: Maciej Skrzypkowski <[email protected]>
d4bec2a
to
c41eb07
Compare
I know this change requires some tests modifications, but first I want your confirmation for what has been changed, and then I'll modify tests. |
@mskrzypkows thanks for PR and investigation, I also took a bit of time to remember and understand the topic. I'm thinking the maybe this was the cause that we missed during the implementation: https://eips.ethereum.org/EIPS/eip-4844#networking. Here it shows a rlp() over those 3 but in fact if we read the EIP carefully the side car shouldn't be actually be rlp encoding because it shouldn't be broadcasted... I see in your web4signer that you call encoding with signatureData, and here you moved that encode in the if block. In your tests were you able to encode and also decode and get the data after the transaction was submitted? |
I have verified it with and without
So first I pass null, encode without a blob sidecar then I encode whole tx with a sidecar. I've verifed the singature and was fine and other tx fileds too, what I haven't checked are blobs binary correctness after getting back signed transaction. I can check it. |
@mskrzypkows Thanks, I understand the flow now and agree the changes with the signature null check make sense for this uses case.
@gtebrean can you elaborate on this? I can see that Besu indeed broadcasts the encoded side car with the PooledTransaction message gossip. Is this Transaction4844 type only intended to be used for signing and sending transactions? If so then I think the PR makes sense as is. |
Hey, sorry, I was off for a bit. @siladu this is what made me think that sidecar shouldn't be actually encoded: @mskrzypkows if the tests done worked fine on your side and as this is the first feedback that we get for the EIP 4844 in Web3j, let's give it a try! Please go ahead with this approach, write/update the unit tests and I will merge it asap to include it in this week release. |
@mskrzypkows btw in the meantime I see this PR was raised, #2205, could you please let me know if this impacts you in any way? |
@gtebrean I've commented that PR, I think that there is a typo.
OK, sounds good. I'll try to add tests this week. |
Signed-off-by: Maciej Skrzypkowski <[email protected]>
Signed-off-by: Maciej Skrzypkowski <[email protected]>
@gtebrean |
Hey folks, at Aztec we're adding support for remote signers to our node for signing transactions and this is currently blocking the PR for EIP-4844 txs in Web3Signer. Any chance we could get this PR merged in and a new version of the library released? Thanks! 😁 |
Hey @gtebrean , can you give any clarity here? Are we awaiting reviews? Is there a better way for the contributors to talk through changes? I saw there is a recurring community call for this repo, but it doesn't meet again until mid October. We'd prefer not to fork, so if there is a way to get this into the main release, that would be good. |
Hi all, as we mentioned on discord since 2 months we have issue with the release process and because of that we were blocked, the PR is fine. repositories> hopefully will have the release also asap |
Thanks! What's your Discord server? |
What does this PR do?
Fixes encoding of EIP-4844 transaction for signing
Where should the reviewer start?
Transaction4844::asRlpValues
Why is it needed?
I've created a PR to the web3signer repository: https://github.com/Consensys/web3signer/pull/1096/files#diff-e3e39c1cb1261aafa22d5bc9fb0e0e28d222a209801620a9242e77c37dfe259eR64
And the serialisation produced wrong signer. When I digged into web3j I realised that for signing EIP-4844 an additional list is added:
List<RlpType> result = new ArrayList<>();
this list shifts signature bytes which are wrongly interpreted when deserialising. That's why I don't add this sidecar list when creating signature. Let me know if it's correct approach.Checklist
issue: #2195