Skip to content

refactor: dedupe CallRequest/TransactionRequest#178

Merged
onbjerg merged 12 commits intomainfrom
onbjerg/rm-callrequest
Feb 9, 2024
Merged

refactor: dedupe CallRequest/TransactionRequest#178
onbjerg merged 12 commits intomainfrom
onbjerg/rm-callrequest

Conversation

@onbjerg
Copy link
Member

@onbjerg onbjerg commented Feb 2, 2024

Motivation

CallRequest and TransactionRequest are basically the same type, with very few differences:

  • TransactionRequest was missing an optional chain ID
  • TransactionRequest was missing max_fee_per_blob_gas
  • CallRequest and TransactionRequest had different blob fields

Since they also serve the same purpose, this PR dedupes them, to make sure there is only one tx request type, which is important for the network abstraction.

Solution

Dedupe them, porting over fields missing from either.

I removed the blob transaction sidecar, but only because I didn't really know if it is actually a part of the spec. As far as I could tell, only blob_versioned_hashes and the gas field is. I asked @mattsse for direction in case he knew, but ultimately we didn't land on anything.

This is a breaking change for obvious reasons, and it not simply a "import new type" migration path, as I also ported over CallInput for TransactionRequest

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@onbjerg onbjerg added the debt Tech debt which needs to be addressed label Feb 2, 2024
@onbjerg
Copy link
Member Author

onbjerg commented Feb 2, 2024

@DaniPopes where do I note breaking changes for the checklist?

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm for unifying them, not worth having duplicate versions of the same thing. especially if we want to use this type as the foundation for building transactions.

before we merge this here, I'd like companion prs on foundry and reth so we can merge them in one go.

Copy link
Contributor

@Evalir Evalir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine w/ me. I'll take care of the foundry companion PR

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last nit

@Evalir
Copy link
Contributor

Evalir commented Feb 8, 2024

gm @onbjerg can this be merged?

@onbjerg onbjerg force-pushed the onbjerg/rm-callrequest branch from 289128b to 0964673 Compare February 9, 2024 11:11
@onbjerg onbjerg requested a review from mattsse February 9, 2024 11:28
@onbjerg onbjerg merged commit 80206e7 into main Feb 9, 2024
@onbjerg onbjerg deleted the onbjerg/rm-callrequest branch February 9, 2024 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

debt Tech debt which needs to be addressed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants