Skip to content

Align the FastNFT model with objects rather than accounts, and abstract fastpay specific details - #3

Merged
gdanezis merged 22 commits into
mainfrom
stripbalance
Nov 30, 2021
Merged

gdanezis merged 22 commits into
mainfrom
stripbalance

Conversation

@gdanezis

@gdanezis gdanezis commented Nov 17, 2021 •

Copy link
Copy Markdown
Contributor

This PR moves the fastpay logic towards the fastX logic as discussed in the spec doc (https://www.overleaf.com/7111272316rvsqhrmycmwn):

  • Remove 'balance' from accounts, and instead turn them into 'objects' with 'owner' and 'contents'
  • Remove cross shard logic since this is specific to async recipient logic for fungible balances. Why?: fastpay cross shard logic is very specific to payments. The funds sender shard sends an asynchronous message to the recipient's shard that increments its balance. In fastx/fastnft we cannot do this, since we do not have a generic way to update other objects asynchronously. So I am deleting all fastpay xshard logic, all the structures that keep track of recipient commands, etc.
  • Remove sync order logic as we will implement bridging differently. Why?: The fastpay synchronization logic is specific to an L1 incrementing the balance of an account within fastpay. This is not a generic bridge, and reproduces all of the coin/payment/account specific assumptions that are not true in fastx/fastnft. So I am removing it, and we should implement a bridging story that is generic for nfts and uses the programmability of fastnft (not available yet).
  • Implement simple transfer as the semantics of the transfer order (only action possible currently, no minting).
  • Fix tests or remove them if they test removed features

When accepted we will need to create the following tickets to continue the evolution:

  • Separate the structures holding transactions, certificates and state out of the objects and into their own maps.
  • Refactor the client that is for the moment still account oriented.
  • Ensure that we use object_ids everywhere, and remove the ugly hack that derives object IDs from addresses in tests and client (need client refactoring).
  • Make the transaction more generic, preferably aligning it to the executor traits in the example code.
  • Adding transaction digests to object references, to have authenticated data structures to facilitate reads.
  • Extend the logic to transactions that use multiple objects rather than a single object.

We still have some way ahead, but this is the first step.

Comment thread fastpay_core/src/authority.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this be <ObjectID, ObjectState>?

@gdanezis gdanezis Nov 18, 2021 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah. Step by step. I am making mini-changes and fixing the tests as I go. Its truly a process of evolution, which you will be able to observe as commits :)

@gdanezis
gdanezis marked this pull request as ready for review November 19, 2021 15:31
@gdanezis
gdanezis requested review from huitseeker and oxade November 19, 2021 15:31
@gdanezis gdanezis changed the title WIP: Align the FastNFT model with objects rather than accounts, and abstract fastpay specific details Align the FastNFT model with objects rather than accounts, and abstract fastpay specific details Nov 19, 2021

@huitseeker huitseeker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for getting the ball rolling!

I've tried to leave comments that would hopefully not impair your ability to make rapid, fundamental changes, while at the same time helping manage the code base so that further readers can still wrap their head around it.

This PR moves the fastpay logic towards the fastX logic as discussed in the spec doc:

Mind including a link to said spec? There's a few I can think of.

Remove cross shard logic since this is specific to async recipient logic for fungible balances.

Could you expand on this one? In particular as I see you keeping shard IDs and probing for the master shard an object is on: what's left of the sharding concept as a whole once we remove X-shard TXes?

More generally, for tests you're mangling without removing: Is there a comment you could add here guiding the future reader as to what functionality the test is still checking, and what it should probe in the future?

Comment thread fastpay/src/bench.rs Resolved
Comment thread fastpay_core/src/authority.rs Resolved
Comment thread fastpay_core/src/authority.rs Resolved
Comment thread fastpay_core/src/authority.rs Outdated
Comment on lines 274 to 276

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are we losing the ability to report on pending TXes here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The .received_log structure was used to keep track of the asynchronous updates into the receiver account. Fastx does not have asynchronous updates, because we do not know how to generalize these to NFTs. So this structure does not exist any more, and therefore we cannot read from it.

Comment thread fastpay_core/src/authority.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we want to add an issue to the list to add a hashpointer to (objectID, seqID - 1)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Actually I think we need to add a hash pointer to the transaction that 'consumed' (objectID, seqID - 1) and created (objectID, seqID). Is that right? (The hash graph goes Obj -> Tx -> Ob -> Tx ...)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yep, indeed! It would be lovely to see this laid out in the spec.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good idea, I spell this out now under a paragraph 'Authenticated Data Structures'

Comment thread fastpay_core/src/authority.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's a matter of comfort, but I find it much easier to move impl Foo for Bar and impl Foo blocks closer to the definition of struct Bar in the same file.

Alternatively, you could push AuthorityState management to another file

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I left them where Fastpay had them. I agree on smaller files in general, lets add a ticket to separate things out a bit.

Comment thread fastpay_core/src/authority.rs Resolved
Comment thread fastpay_core/src/base_types.rs Resolved

@huitseeker huitseeker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I took the liberty to rebase (to get CI signal) and fix the knucklehead stuff. I left a few comments, but this is pretty close to a mergeable state now!

@@ -488,23 +492,26 @@ where
/// Send money to a FastPay or Primary recipient.
async fn transfer(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It would be really great to clean up the code comments in this function a bit. Those that remain would be improved by a description of the equivalent functionality that's left to provide in the FastNFT world.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good call again. I removed the code comments (they were forgotten) and added a couple of TODOs in the client trait about having to adapt it to fastnft.

Comment on lines 257 to 258
#[test]
fn test_bidirectional_transfer() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One line of comment to outline the future functionality to be tested?

}

/*
#[test]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same here: a one-liner to outline what this should look like in the FastX world wouldn't go amiss.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I re-enabled this test, and commented the 'sending back' part of it, with a TODO: FIX comment to fix the client and then test the sending back functionality.

Comment on lines 76 to 77
fn test_handle_redeem_transaction_negative_balance() {
let (mut contract_state, name, secret) = init_contract();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

IIUC, in the non-fungible world, this amounts to sending an object you don't have, wouldn't this basically test the same thing as bidirectional transfer (i.e. happened-before functionality) ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added a comment to fix once we have more functionality.

/*
#[test]
fn test_format() {
let status = std::process::Command::new("cargo")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

FYI, this happens to work for me, albeit in a now-outdated format.

Comment thread fastpay/src/bench.rs
self.port,
state,
self.buffer_size,
self.cross_shard_queue_size,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this makes the field in ClientServerBenchmark completely useless and removable now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, but I want to fix it when I fix the client to follow the fastnft protocol.

- Reenable client text with TODO on how to fix it when we have more fnft clients
- Added todo on negative balance test
- Added comments on format test
- Make fmt happy
@gdanezis
gdanezis merged commit 9e91225 into main Nov 30, 2021
@gdanezis
gdanezis deleted the stripbalance branch November 30, 2021 16:24
lxfind added a commit that referenced this pull request Feb 1, 2022
…lity

[Object Ownership #3] Check object owner in authority
damirka added a commit that referenced this pull request Jan 27, 2023
williampsmith pushed a commit that referenced this pull request Feb 3, 2023
brson pushed a commit to brson/sui that referenced this pull request Apr 30, 2024
Port Solana move changes to Sui tree
tx-tomcat pushed a commit to tx-tomcat/sui-network that referenced this pull request May 29, 2024
# This is the 1st commit message:

implement rules

# This is the commit message MystenLabs#2:

test squash commit

# This is the commit message MystenLabs#3:

Implement base for new rules

add some rules

Deref ref lint rules

Update redundant_deref_ref.rs

remove unused code

re-impl

add license
jordanjennings-mysten referenced this pull request in jordanjennings-mysten/sui Oct 22, 2024
# This is the 1st commit message:

reword

# The commit message #2 will be skipped:

# fix

# The commit message #3 will be skipped:

# fix

# The commit message #4 will be skipped:

# fix
wtdcode added a commit to abortfuzz/sui that referenced this pull request Nov 26, 2025
jessiemongeon1 added a commit that referenced this pull request May 7, 2026
## Summary

Automated documentation fixes based on the weekly docs audit report.

### Fixed issues

- 🔴 **#1** [HIGH]: CLI: `send-funds` command missing from docs snippet
- 🔴 **#2** [HIGH]: Move CLI: `sui move new` generated `Move.toml` is
completely outdated
- 🔴 **#3** [HIGH]: Move CLI: Directory listing shows `Sources` (capital
S) instead of `sources`
- 🟡 **#20** [MEDIUM]: Move build output mentions `UPDATING GIT
DEPENDENCY`
- 🟡 **#21** [MEDIUM]: Move coverage: Claims debug build is required
- 🔴 **#4** [HIGH]: Exchange Integration: `sui_getEvents` API used with
wrong signature
- 🔴 **#5** [HIGH]: Exchange Integration: Variable name bug in curl
example
- 🔴 **#6** [HIGH]: Exchange Integration: Uses devnet URLs for production
guidance
- 🔴 **#9** [HIGH]: Duplicate exchange integration docs
- 🔴 **#10** [HIGH]: Exchange Integration: Rust SDK examples use
deprecated `SuiClientBuilder` with JSON-RPC
- 🟡 **#22** [MEDIUM]: Exchange Integration: `read_api().get_balance()`
pattern
- 🔴 **#7** [HIGH]: Validator CLI: Missing commands in docs
- 🔴 **#8** [HIGH]: Research Papers: Outdated consensus description
- 🟡 **#11** [MEDIUM]: GraphQL: Hardcoded version number `1.56.1`
- 🟡 **#12** [MEDIUM]: External Signers: Hardcoded minimum version
- 🟡 **#13** [MEDIUM]: Package Management: Hardcoded `toolchain-version =
"1.64.0"`
- 🟡 **#14** [MEDIUM]: Full Node Config: `enable-event-processing` in
template but not in NodeConfig
- 🟡 **#15** [MEDIUM]: Full Node Config: `rpc.enable-indexing` not
prominently documented
- 🟢 **#28** [LOW]: Full node setup: Genesis blob URLs use `curl -fLJO`
- 🟡 **#16** [MEDIUM]: Consensus: Performance numbers may be stale
- 🟡 **#17** [MEDIUM]: `client.mdx`: Dynamic field example shows
`SuiSystemStateInnerV2`
- 🟡 **#18** [MEDIUM]: Release Notes: Broken external URL
- 🟡 **#19** [MEDIUM]: DeepBook Margin SDK: Hardcoded fullnode URLs
- 🟢 **#25** [LOW]: Observability doc is marked as draft
- 🟢 **#26** [LOW]: Tokenized Asset docs reference `UPDATING GIT
DEPENDENCY`
- 🟢 **#27** [LOW]: Install from source: `--features tracing`
documentation

### Files changed

- `docs/content/snippets/console-output/sui-client-help.mdx`
- `docs/content/references/cli/move.mdx`
- `docs/content/operators/exchange-integration.mdx`
- `docs/content/references/exchange-integration-guide.mdx`
- `docs/content/references/cli/validator.mdx`
- `docs/content/references/research-papers.mdx`
- `docs/content/develop/accessing-data/using-events.mdx`
- `docs/content/develop/accessing-data/graphql/query-with-graphql.mdx`
- `docs/content/references/cli/external-signers.mdx`
- `docs/content/develop/manage-packages/move-package-management.mdx`
- `docs/content/operators/full-node/sui-full-node.mdx`
- `docs/content/develop/sui-architecture/consensus.mdx`
- `docs/content/references/cli/client.mdx`
- `docs/content/references/release-notes.mdx`
-
`docs/content/onchain-finance/deepbook-margin-sdk/deepbook-margin-sdk.mdx`
- `docs/content/operators/observability.mdx`
-
`docs/content/onchain-finance/tokenized-assets/deploy-tokenized-asset.mdx`
- `docs/content/getting-started/onboarding/install-source.mdx`

### Skipped (manual action needed)

- 🟢 **#23** [LOW]: `completion` subcommand not independently documented
- 🟢 **#24** [LOW]: `fire-drill` subcommand not documented

---

*This PR was automatically generated by the Docs Audit Fixer. Please
review the changes carefully before merging.*
jessiemongeon1 added a commit that referenced this pull request May 11, 2026
## Summary

Automated documentation fixes based on the weekly docs audit report.

### Fixed issues

- 🔴 **#1** [HIGH]: zkLogin Integration: Devnet hardcoded as the example
RPC URL
- 🟡 **#2** [MEDIUM]: Gasless Stablecoin Transfers: Eligible stablecoins
linked to a merged PR, not stable docs
- 🟡 **#3** [MEDIUM]: `references/cli.mdx`: Wrong capitalization in suiup
GitHub URL
- 🟡 **#4** [MEDIUM]: `references/cli.mdx`: `external-keys` command not
listed in CLI overview
- 🟡 **#5** [MEDIUM]: DeepBook Predict docs: pinned to feature branch
`predict-testnet-4-16` — will go stale
- 🟡 **#6** [MEDIUM]: Client CLI: Several newer commands have no examples
in `client.mdx`
- 🟡 **#7** [MEDIUM]: zkLogin demo: VITE_NETWORK=devnet in .env example
- 🟢 **#10** [LOW]: indexer `build.mdx`: "Recommended" pattern still
starts with 30-day-retention HTTPS endpoint
- 🟢 **#11** [LOW]: DeepBook Predict server URL not in main contract
information page
- 🟢 **#12** [LOW]: `references/sui-move.mdx` links to `move-summary`
snippet that may need updating

### Files changed

- `docs/content/sui-stack/zklogin-integration/index.mdx`
-
`docs/content/develop/transaction-payment/gasless-stablecoin-transfers.mdx`
- `docs/content/references/cli.mdx`
- `docs/content/onchain-finance/deepbook-predict/deepbook-predict.mdx`
- `docs/content/references/cli/client.mdx`
- `docs/content/sui-stack/zklogin-integration/zklogin-demo.mdx`
- `docs/content/develop/accessing-data/custom-indexer/build.mdx`
-
`docs/content/onchain-finance/deepbook-predict/contract-information.mdx`
- `docs/content/references/sui-move.mdx`

### Skipped (manual action needed)

- 🟢 **#8** [LOW]: `completion` subcommand still not documented
- 🟢 **#9** [LOW]: `fire-drill` subcommand still not documented

---

*This PR was automatically generated by the Docs Audit Fixer. Please
review the changes carefully before merging.*

---------

Co-authored-by: wlmyng <[email protected]>
jessiemongeon1 added a commit that referenced this pull request May 26, 2026
## Summary

Automated documentation fixes based on the weekly docs audit report.

### Fixed issues

- 🟡 **#4** [MEDIUM]: Custom indexer docs still make the 30-day HTTPS
checkpoint endpoint part of the canonical “recommended” startup command

### Files changed

- `docs/content/develop/accessing-data/custom-indexer/build.mdx`

### Skipped (manual action needed)

- 🟡 **#1** [MEDIUM]: Full node docs still point to the YAML template for
the “complete list” of `rpc` options, but the template does not contain
that list
- 🟡 **#2** [MEDIUM]: `client.mdx` still omits examples for several
commands that ship in `sui client --help`
- 🟡 **#3** [MEDIUM]: zkLogin demo still defaults to Devnet even though
the main zkLogin guide was corrected to Testnet
- 🟡 **#5** [MEDIUM]: DeepBook Predict docs still carry a stale freshness
marker and remain pinned to a dated Testnet branch
- 🟡 **#6** [MEDIUM]: New v2alpha ledger-history list APIs and their
required full-node knobs are effectively undocumented
- 🟢 **#7** [LOW]: `completion` still has no dedicated docs page
- 🟢 **#8** [LOW]: `fire-drill` still has no docs page or “internal-only”
note
- 🟢 **#9** [LOW]: `MystenLabs` GitHub URL casing is still inconsistent
in multiple docs

---

*This PR was automatically generated by the Docs Audit Fixer. Please
review the changes carefully before merging.*
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