Skip to content
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

Malformatted L1 Deposit Log #3

Closed
trianglesphere opened this issue Jan 13, 2022 · 9 comments
Closed

Malformatted L1 Deposit Log #3

trianglesphere opened this issue Jan 13, 2022 · 9 comments
Labels
bug Something isn't working

Comments

@trianglesphere
Copy link

Setup

  • Geth: proto/bellatrix-api-fixes
  • L2 (OE) Geth: origin/optimism-prototype
  • Rollup Node: input-deriv-test-cleanup
  • Contracts: From the specs repo. I think they should be in sync

Sending a deposit Tx in the following way (want to mint L2 eth, no contracts or data).

deposit="0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001"
abi="depositTransaction(address,uint256,uint256,bool,bytes)"
account="0x30ec912c5b1d14aa6d1cb9aa7a6682415c4f7eb0"

seth send --password signer_password.txt --keystore data_l1/keystore -F $account $deposit "$abi" $account $(seth --to-wei 1 eth) 1000000 false 0x

Result:

ERROR[01-13|10:40:42.016] Failed to extend L2 chain with new L1 block engine=0 l1=ef188f..1b3981:20 l2=8654b2..a97c39:19 err="failed to derive execution payload inputs: failed to derive user deposits: malformatted L1 deposit log: deposit event data too small (192 bytes): 
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000f4240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000"
@protolambda
Copy link
Owner

protolambda commented Jan 13, 2022

Are you running the latest staging branch or another thing? Nvm, I see input-deriv-test-cleanup, that should be good, hmm

We added the mint param to the deposit log later on, so maybe it's failing to parse it because that code change is missing

@protolambda
Copy link
Owner

Found the off by one: 6*32 = 192, 7*32=224

https://github.com/ethereum-optimism/optimistic-specs/blob/212f234ee7bcfd5e813f9c6c2cd12058cfb0f989/opnode/l2/input_derivation.go#L47

Here it increments the offset 6 times with 32 bytes to get to the dynamic remainder of the log data. It starts at 0, not at 32 though, so it should be 6*32.

Will fix, thanks for the bug report!

@protolambda protolambda added the bug Something isn't working label Jan 13, 2022
@trianglesphere
Copy link
Author

Ok. I'm going to double check the contract version. Skimming the L1 contract, it seems like it hasn't been updated in over a week (other than some solc changes)

@trianglesphere
Copy link
Author

FYI there are 7 fields, but I'm less familiar with how dynamic length fields / bools are packed in

@trianglesphere
Copy link
Author

Example log split at 32 byte intervals

address to
address from
u256 mint
u256 value
u256 gasLimit
bool creation
bytes data

0000000000000000000000000000000000000000000000000000000000000000   - to? 
0000000000000000000000000000000000000000000000000de0b6b3a7640000   - from?
00000000000000000000000000000000000000000000000000000000000f4240   - 1000000 (mint/value)
0000000000000000000000000000000000000000000000000000000000000000   - value?
00000000000000000000000000000000000000000000000000000000000000a0   - ??
0000000000000000000000000000000000000000000000000000000000000000   - empty data

@protolambda
Copy link
Owner

Updated input-deriv-test-cleanup and cherry-picked to staging

@protolambda
Copy link
Owner

0000000000000000000000000000000000000000000000000000000000000000  # value: 0 (transfer 0 on L2)
0000000000000000000000000000000000000000000000000de0b6b3a7640000  # mint: 0xde0b6b3a7640000 = 1000000000000000000 = 1 ETH (move 1 ETH from L1 to L2)
00000000000000000000000000000000000000000000000000000000000f4240  # gas: 0xf4240 = 1000000
0000000000000000000000000000000000000000000000000000000000000000  # isCreation (boolean set to false)
00000000000000000000000000000000000000000000000000000000000000a0  # data offset: 0xa0 = 160 = 32*5 bytes
0000000000000000000000000000000000000000000000000000000000000000  # data length: 0
# no data contents since length was 0

The to and from are separate from that data, since those are indexed log fields

@trianglesphere
Copy link
Author

Ok. I got it. I used the new version and was able to see the balance of the account increase on L2

@trianglesphere
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants