-
Notifications
You must be signed in to change notification settings - Fork 46
Update bundle receipt to match ethers transaction response #480
Update bundle receipt to match ethers transaction response #480
Conversation
); | ||
|
||
// Assert | ||
// TODO: bls-wallet #412 Update values returned in bundle receipt to more closely match ethers transaction response | ||
const expectedBlockNumber = await blsProvider.getBlockNumber(); | ||
expect(transactionReceipt).to.be.an("object").that.deep.includes({ |
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.
These assertions are more verbose but feel like the tradeoff is worth it unless anyone has suggestions on making them more concise.
If someone edits the return value in the BundleService, either by removing a property or changing property types, the test will fail. Note the test does not fail if someone adds an invalid property to the bundle receipt see comment
contracts/clients/src/Aggregator.ts
Outdated
/** | ||
* The bundle receipt returned from a BLS Wallet Aggregator instance. It is a combination of an ethers {@link ContractReceipt} and a {@link BlsWallet} type. | ||
*/ | ||
export type BundleReceipt = ContractReceipt & { |
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.
Been thinking about validation in this file. I tried adding a property to the return type for receiptFromBundle
- invalidProperty: "invalid property”,
and it was successfully propagated to the provider. When we’re using our own aggregator, we have confidence the bundleReceipt will have certain properties, and as mentioned in this comment, our integration tests will pick up certain changes to the returned bundleReceipt. But what if a third party developer is using the client module/provider and decides to use their own aggregator. In this case, invalid responses could reach client module code.
My question is, should we validate incoming responses so that we don’t allow invalid data into the client module? Maybe a future issue?
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.
I think that is probably a good future issue. Just my opinion but I think validating the contract receipt right now might be a little scope creep. This is probably something we can handle if people start using other aggregators that don't follow our pattern here.
contracts/clients/src/Aggregator.ts
Outdated
/** | ||
* The BLS Wallet specific values in a {@link BundleReceipt}. | ||
*/ | ||
export type BlsWallet = { |
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.
Can't decide if I like this name, any suggestions welcome.
Few random ideas:
BlsWalletReceipt
BlsTransactionReceipt
BlsBundleReceipt
BundleTransactionsReceipt
Bundles
BlsBundles
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.
Yeah I agree, I think it would be good to have the word receipt in the name. Maybe something like BlsBundleReceipt sounds good 👍
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.
BlsBundleReceipt sounds good to me, will update
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.
Nice, this looks good!
I think this is the process that is typically used for client updates. But the only additional thing I would do is push up an experimental version of the client library. That way we can update the client version in the aggregator and the extension and make sure everything is working together. Then I think in a future PR if everything is working as expected we can create a new official release.
@@ -217,17 +217,17 @@ describe("Signer contract interaction tests", function () { | |||
}); | |||
|
|||
// TODO: Investigate why safeMint() fails with a BLS wallet address. Note - it passes in isolation | |||
it("safeMint() call fails with BLS wallet address", async function () { | |||
it.skip("safeMint() call fails with BLS wallet address", async function () { |
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.
Do we still want this skipped?
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.
It seems to be passing in isolation but then failing when run with other tests. Thought it would be better to skip it in case it causes issues like some other integration tests have, then implement a fix for it. I can add a follow up issue to look into it so it's tracked.
Let me know if you have any additional thoughts
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.
Follow up #484
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.
Nope, that sounds good! I just wanted to make sure it wasn't an accidental add.
contracts/clients/src/Aggregator.ts
Outdated
/** | ||
* The bundle receipt returned from a BLS Wallet Aggregator instance. It is a combination of an ethers {@link ContractReceipt} and a {@link BlsWallet} type. | ||
*/ | ||
export type BundleReceipt = ContractReceipt & { |
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.
Will this updated type break anything in the extension?
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.
Tested the extension locally and is able to get the transaction receipt successfully. The transaction hashes lined up with what was logged in the aggregator logs.
Thinking about it, I might check it works on testnet as well as locally - then I can check the transaction hash works on etherscan
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.
Just tested successfully via quill running a local aggregator pointing at arbitrum goerli.
The extension does not query the hash via bundleReceipt.bundleHash
, so it still works (if it did query the hash this way, it would break).
It appears to save the bundle hash here so it doesn't have to query it.
It also uses the returned bundle hash here to get the transaction receipt.
Can't see anywhere else it could break to my knowledge.
05f8972
to
6dbee9f
Compare
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.
thanks for the updates 👍
What is this PR doing?
BundleServiceSubmitting.test.ts
to ensurereceiptFromBundle
works and returns the bundle hash.Aggregator.ts
)_getTransactionReceipt
method to return the updated type.How can these changes be manually tested?
Does this PR resolve or contribute to any issues?
#435
Checklist
Guidelines
resolve conversation
button is for reviewers, not authors