iroha icon indicating copy to clipboard operation
iroha copied to clipboard

[feature] #2085: Authenticate personal accounts by ID

Open s8sato opened this issue 1 year ago • 4 comments

Description

[feature] #2085: Authenticate personal accounts by ID

This is a milestone for the following commit. The inclusion of the public key in the ID allows the ID to match the verifying key of the signature. This makes it possible to authenticate transactions and queries with the ID alone.

  • api-changes: single signatory account, single signature transaction
  • api-changes: remove query FindAccountsByName
  • config-changes: client config account.id changes to account.domain_id
  • add test_samples utility for tests
  • different notions of signatories "peer", "genesis", and "alice" in the test network

~~[feature] #2085: Auto-register destination account on transfer~~

~~Includes registration of the destination account in the transfer execution. The main use case is described in test auto_register_account::on_transfer::asset_numeric~~

  • EDIT: left to #4426

Linked issue

  • This is the 1st of the 3-part work of account restructuring:
    • Closes #2085
      • Opens #4426
    • #4372
    • #4373
  • Opens #4410
  • Contains suggestions for #4409
  • Closes #3511

Benefits

As long as you know the address (account ID), you can send without worrying whether the destination account is already registered on the chain. However, the current design requires the sender to be authorized to register a new account within the domain. See https://github.com/hyperledger/iroha/pull/4411#discussion_r1552269607

Drawbacks

  • Conventional name@domain notation will be temporary lost
    • To be restored with #4372
  • Multi-signature functionality will be temporary lost, coupled with the queue change
    • To be restored and enhanced with #4373

Checklist

  • [x] I've read CONTRIBUTING.md
  • [x] I've used the standard signed-off commit format (or will squash just before merging)
  • [ ] All applicable CI checks pass (or I promised to make them pass later)
  • [x] I've written unit tests for the code changes
  • [ ] I replied to all comments after code review, marking all implemented changes with thumbs up

s8sato avatar Apr 04 '24 18:04 s8sato

@BAStos525

github-actions[bot] avatar Apr 04 '24 18:04 github-actions[bot]

Pull Request Test Coverage Report for Build 8595871540

Details

  • 378 of 511 (73.97%) changed or added relevant lines in 32 files are covered.
  • 5535 unchanged lines in 97 files lost coverage.
  • Overall coverage increased (+0.4%) to 57.185%

Changes Missing Coverage Covered Lines Changed/Added Lines %
client/src/lib.rs 0 1 0.0%
core/src/queue.rs 56 57 98.25%
torii/src/lib.rs 0 1 0.0%
client_cli/src/main.rs 0 2 0.0%
smart_contract/executor/src/default.rs 0 2 0.0%
client/src/config/user.rs 0 3 0.0%
client/src/config/user/boilerplate.rs 0 3 0.0%
core/src/smartcontracts/isi/query.rs 10 13 76.92%
data_model/src/asset.rs 59 62 95.16%
smart_contract/src/lib.rs 0 5 0.0%
<!-- Total: 378 511
Files with Coverage Reduction New Missed Lines %
primitives/src/conststr.rs 1 91.14%
crypto/src/hash.rs 1 73.78%
ffi/derive/src/convert.rs 1 84.45%
primitives/src/lib.rs 1 0.0%
core/src/sumeragi/network_topology.rs 1 98.78%
primitives/src/must_use.rs 2 74.29%
crypto/src/signature/bls/mod.rs 2 0.0%
config/src/snapshot.rs 3 78.57%
data_model/derive/src/has_origin.rs 3 95.16%
config/src/kura.rs 3 80.0%
<!-- Total: 5535
Totals Coverage Status
Change from base Build 7884695009: 0.4%
Covered Lines: 22990
Relevant Lines: 40203

💛 - Coveralls

coveralls avatar Apr 05 '24 03:04 coveralls

Updated, see this comparison. The changes are as follows:

  • remove the 2nd commit: Auto-register destination account on transfer
  • fix pytest account structure
  • move iroha_sample_params directory to under the root
  • initialize and load SampleParams in static memory at the first call
  • document to alert parse_alias() is for testing only
  • provide (Account/Asset)Id::from_alias() syntax
  • remove imports under features

Then, now rebasing

s8sato avatar Apr 23 '24 07:04 s8sato

Some discussions are now outside the scope of this PR, so they will be folded once and tracked in #4426

s8sato avatar Apr 24 '24 05:04 s8sato

  • Made GENESIS_PUBLIC_KEY an arg in kagami. See diff
  • cargo test -p iroha_core --lib -- snapshot::tests::can_read_snapshot_after_writing seems to be failing since 1606d088f

s8sato avatar May 14 '24 14:05 s8sato

cargo test -p iroha_core --lib -- snapshot::tests::can_read_snapshot_after_writing seems to be failing since https://github.com/hyperledger/iroha/commit/1606d088fdbfaec3d8cce4a561e2991ba24c49c6

Going to fix this issue

Erigara avatar May 14 '24 16:05 Erigara

  • Reverted it to be ignored: cargo test --all-features -p iroha_smart_contract --doc -- parse has been failing even before this PR

s8sato avatar May 15 '24 06:05 s8sato