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

Only accept control transactions over the control transaction topic #2627

Merged
merged 7 commits into from
Jun 18, 2024

Conversation

hrxi
Copy link
Contributor

@hrxi hrxi commented Jun 17, 2024

Do this by using a wrapper that only accepts control transactions.

Fixes #2614.

@hrxi hrxi force-pushed the hrxi/ctrl_transaction branch 2 times, most recently from 72ad684 to dc88d07 Compare June 17, 2024 09:26
type Error = ControlTransactionError;

fn try_from(tx: Transaction) -> Result<ControlTransaction, ControlTransactionError> {
if tx.sender_type != AccountType::Staking && tx.recipient_type != AccountType::Staking {
Copy link
Member

Choose a reason for hiding this comment

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

Should we also check if the value is 0 here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We discussed this shortly, and the answer was yes. However, since that is a breaking change, it cannot go into the next (compatible) testnet release.

Copy link
Member

@sisou sisou Jun 17, 2024

Choose a reason for hiding this comment

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

Signaling transactions also have TransactionFlags::SIGNALING set, but AFAIK the combination of that flag and zero value is already checked in the transaction's internal validity and/or parser.

The parsed IncomingStakingTransactionData has a .is_signaling() method:

@hrxi hrxi force-pushed the hrxi/ctrl_transaction branch 3 times, most recently from 0e81d31 to c1d958d Compare June 18, 2024 15:02
viquezclaudio and others added 7 commits June 18, 2024 18:32
Don't verify contributions whose contributors are a subset of the already verified contributors.
Bumps the minor-and-patch-updates group with 1 update: [derive_more](https://github.com/JelteF/derive_more).


Updates `derive_more` from 0.99.17 to 0.99.18
- [Release notes](https://github.com/JelteF/derive_more/releases)
- [Changelog](https://github.com/JelteF/derive_more/blob/v0.99.18/CHANGELOG.md)
- [Commits](JelteF/derive_more@v0.99.17...v0.99.18)

---
updated-dependencies:
- dependency-name: derive_more
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch-updates
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5.4.0 to 6.0.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](docker/build-push-action@ca052bb...c382f71)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Do this by using a wrapper that only accepts control transactions.

Fixes #2614.
@hrxi hrxi force-pushed the hrxi/ctrl_transaction branch from c1d958d to ca3dc07 Compare June 18, 2024 16:06
@hrxi hrxi mentioned this pull request Jun 18, 2024
@hrxi hrxi merged commit ca3dc07 into albatross Jun 18, 2024
6 checks passed
@hrxi hrxi deleted the hrxi/ctrl_transaction branch June 18, 2024 16:39
@jsdanielh jsdanielh added this to the Nimiq PoS Mainnet milestone Jun 22, 2024
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.

Normal transactions can be sent via the control transaction topic
6 participants