chore!: do not use dynamic types in interfaces#14203
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
LHerskind
left a comment
There was a problem hiding this comment.
Need a rebase for the conflicts but I like it 👍
| header = DecoderBase.updateHeaderFeeRecipient(header, address(0)); | ||
| header = DecoderBase.updateHeaderBaseFee(header, manaBaseFee); | ||
| header = DecoderBase.updateHeaderManaUsed(header, manaSpent); | ||
| header.lastArchiveRoot = archiveRoot; |
| ]; | ||
|
|
||
| const header = ProposedBlockHeader.fromBuffer(Buffer.from(hexToBytes(decodedArgs.header))); | ||
| // TODO(md): why is the proposed block header different to the actual block header? |
There was a problem hiding this comment.
Costs I believe. But I agree, foot gun territory
There was a problem hiding this comment.
Yeah it's mainly for reducing cost - it's 316 bytes vs 592 bytes calldata and sha hashing. But if we prefer a more consistent type to reducing a little bit of cost, I can change it back!
| }, | ||
| slotNumber: `0x${block.header.globalVariables.slotNumber.toBuffer().toString('hex').padStart(64, '0')}`, | ||
| timestamp: Number(block.header.globalVariables.timestamp.toBigInt()), | ||
| slotNumber: block.header.globalVariables.slotNumber.toBigInt(), |
There was a problem hiding this comment.
Would kinda have expected this to blow up. As I recall, we were doing the throwing around because json stringify were not too happy about the bigints 🤷
There was a problem hiding this comment.
In process of rebasing and yes. This completely explodes all over the place.
| 'uint8, ' + //domainSeperator | ||
| '(' + | ||
| 'bytes32, ' + // archive | ||
| '((bytes32,uint32),((bytes32,uint32),(bytes32,uint32),(bytes32,uint32))), ' + // stateReference |
There was a problem hiding this comment.
Thats one ugly looking line 😬 Don't we have any neat way we could get this thing directly from the abis or so instead 🤔 Or guess it would just explode so maybe not too big a deal if easy to spot.
|
@Maddiaa0 can you take a look again at this? It seems like it was broken in #14466 because the data generation used the now changed defaults or so 🤷 @sirasistant running into some pain as it have been broken and it only popped up along with his changes. |
df9126f to
2370e77
Compare
2370e77 to
2626607
Compare
|
Throwing this onto the queue again even if @charlielye call it a crime, as it seems like it failed to be merged, but no test failed 😅 so not sure why it did not make it. Doing a rebase first though. |
2626607 to
be74542
Compare
|
Latest failure on the merge queue was due to a sporadic issue in Anvil that Alex have dealt with in foundry-rs/foundry#10714 |
be74542 to
945751e
Compare
## Overview Rollup: - migrates propose interface to use the Header object directly, not bytes as will always know its type - re instantes the state commitment type rather than using bytes, as it is a fixed size object Tests: - Load the header from the block snapshots directly, instead of working on the bytes object as we KNOW its type - does this by shimming the alphabetical json into the real object in the load block section - removes functions that set the header values based on bytes offsets, instead, just manipulate the object directly --------- Co-authored-by: LHerskind <16536249+LHerskind@users.noreply.github.com>

Overview
Rollup:
Tests: