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

Add chain/addTransaction for signed transaction #3716

Closed
wants to merge 6 commits into from

Conversation

hairtail
Copy link
Contributor

Summary

Add chain/postTransaction to post/broadcast an already signed transaction.

Testing Plan

Documentation

Does this change require any updates to the Iron Fish Docs (ex. the RPC API
Reference
)? If yes, link a
related documentation pull request for the website.

Yes

Breaking Change

Is this a breaking change? If yes, add notes below on why this is breaking and
what additional work is required, if any.

[ ] Yes

@hairtail hairtail requested a review from a team as a code owner March 30, 2023 11:32
@hairtail hairtail changed the title Add chain/postTransaction for signed transaction Add chain/addTransaction for signed transaction Mar 30, 2023
@hairtail
Copy link
Contributor Author

Guess i should tell the reason why this PR and this rpc route again. As i have said days before #3666, in my opinion and as most projects did (like btc, ethereum, filecoin etc), the chain based routes (like getBlock getNoteWitness) should be public accessible while the wallet based routes (like create sendTransaction) should be strictly limited.

ironfish/src/rpc/routes/chain/addTransaction.ts Outdated Show resolved Hide resolved
Comment on lines 55 to 49
const fourthVerify = node.wallet.memPool.acceptTransaction(transaction)
if (!fourthVerify) {
request.end({ success: false, reason: 'Mempool rejected' })
}
Copy link
Contributor

Choose a reason for hiding this comment

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

acceptTransaction could return false if the mempool already has the transaction. Should this endpoint continue even if acceptTransaction returns false in that case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

'Mempool reject' or 'Add transaction fails' should be returned in my opinion.

ironfish/src/rpc/routes/chain/addTransaction.ts Outdated Show resolved Hide resolved
ironfish/src/rpc/routes/chain/addTransaction.ts Outdated Show resolved Hide resolved
@holahula
Copy link
Contributor

holahula commented Apr 5, 2023

Hi @hairtail, this functionality will be added in #3742. Am I good to close this PR?

There are a few changes to functionality:

  • The endpoint will always broadcast as long as the transaction is validated. This is useful for re-broadcasting.
  • Being accepted into the mempool should not stop broadcasting because there are additional criteria for being accepted into the mempool that should not affect this functionality.

@hairtail
Copy link
Contributor Author

hairtail commented Apr 6, 2023

Functionality will be added in another PR by the team.

@hairtail hairtail closed this Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants