You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into an issue with setting up the protobufs for batch txs. Transaction in transaction.proto contains TransactionBody in transaction_body.proto (in the deprecated body field). We want TransactionBody to contain AtomicBatchTransactionBody which contains Transaction. This sets up a circular reference and makes the protobuf compiler mad.
Solution
Option 1: Delete the deprecated body field from Transaction. I started down this path as part of PR #17333. Practically all of the places it was referenced were in tests, so it was a bit of work but not completely unreasonable. I think that if we’re going to delete the deprecated body field we should also delete the other deprecated fields in the Transaction message. However, I’m a bit leery of changing protobufs like this. Are there ancient transactions which depend on it? Is there a reason why these fields were marked deprecated instead of removed altogether? Update: this option will not work per this PR and discussion with the team
Option 2: Combine transation.proto, transaction_body.proto and atomic_batch.proto into a single proto file. This feels messy but should solve the circular dependency
Option 3: We could have a custom transaction.proto(called atomic_transaction.proto or something) with only bytes signedTransactionBytes field in it. And then AtomicBatchTransactionBody would refer to that instead of Transaction
Option 4:AtomicBatchTransactionBody should contain bytes instead of a Transaction.
Instead of this:
Problem
I ran into an issue with setting up the protobufs for batch txs.
Transaction
intransaction.proto
containsTransactionBody
intransaction_body.proto
(in the deprecatedbody
field). We wantTransactionBody
to containAtomicBatchTransactionBody
which containsTransaction
. This sets up a circular reference and makes the protobuf compiler mad.Solution
Option 1: Delete the deprecated
body
field fromTransaction
. I started down this path as part of PR #17333. Practically all of the places it was referenced were in tests, so it was a bit of work but not completely unreasonable. I think that if we’re going to delete the deprecatedbody
field we should also delete the other deprecated fields in the Transaction message. However, I’m a bit leery of changing protobufs like this. Are there ancient transactions which depend on it? Is there a reason why these fields were marked deprecated instead of removed altogether? Update: this option will not work per this PR and discussion with the teamOption 2: Combine
transation.proto
,transaction_body.proto
andatomic_batch.proto
into a single proto file. This feels messy but should solve the circular dependencyOption 3: We could have a custom
transaction.proto
(calledatomic_transaction.proto
or something) with onlybytes signedTransactionBytes
field in it. And thenAtomicBatchTransactionBody
would refer to that instead ofTransaction
Option 4:
AtomicBatchTransactionBody
should contain bytes instead of a Transaction.Instead of this:
We’d have this:
The text was updated successfully, but these errors were encountered: