Skip to content

Conversation

longbowlu
Copy link
Contributor

In this PR we add execute_transaction endpoint in fullnode.

  1. add QuorumDriverApi since its execution_transaction function's signature is different from RpcGatewayApi, including param list and result type
  2. FN enable this api by default.

Next:

  1. e2e test
  2. metrics
  3. eagerly update txns from quorum driver(?)

see also:
#3778


pub struct FullNodeQuorumDriverApi {
pub quorum_driver: Arc<QuorumDriver<NetworkAuthorityClient>>,
pub module_cache: Arc<SyncModuleCache<ResolverWrapper<AuthorityStore>>>,
Copy link
Contributor

Choose a reason for hiding this comment

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

This one makes me a bit nervous, as it makes quorum driver dependent on the store.
Do we have a concrete use case where tx sender wants to see events in json format?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point. I don't really know but has increasingly started to think we just need bcs in the responses. Let's make an issue for this and move the discussion there - if we want to remove the parsed structs, we should phase them out entirely. cc @patrickkuo

/// Flag of the signature scheme that is used.
sig_scheme: SignatureScheme,
/// transaction signature, as base-64 encoded string
signature: Base64,
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure if you've rebased recently, but be aware that signature is now part of the signed data, so this should perhaps be refactored to reflect that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

initially I tried to use TransactionData v.s. this bunch of things but it did not work out for some doc reasons. If I recall correctly, something in move-lang repo is not compatible with how we generate our api docs and refuse to compile .. @patrickkuo do you have some ideas whether/how this can be fixed?

Copy link
Contributor

Choose a reason for hiding this comment

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

The types in message.rs are not json/schema friendly, we have created another set of rpc types mirroring them, e.g. TransactionData <> SuiTransactionData, we can create a SuiSenderSignedData for this.

@mystenmark
Copy link
Contributor

I'm curious what our story is about equivocation prevention as we move to deprecate gateway

@longbowlu longbowlu enabled auto-merge (squash) August 16, 2022 18:31
@longbowlu longbowlu merged commit db9f2e2 into main Aug 16, 2022
@longbowlu longbowlu deleted the quorum-driver-2 branch August 16, 2022 18:43
@oxade
Copy link
Contributor

oxade commented Aug 16, 2022

I'm curious what our story is about equivocation prevention as we move to deprecate gateway

Best I've heard is potentially resolving them at epoch change

@lxfind
Copy link
Contributor

lxfind commented Aug 16, 2022

We will need to do this in gateway->sdk because a user should not be able to easily trigger equivocation through normal operations, and a user should be able to send multiple transactions in parallel that use different gas objects.

@lxfind
Copy link
Contributor

lxfind commented Aug 16, 2022

But of course in the end at epoch boundary we will also be able to remove any object locks as well, but that's a last resort

pub transaction_effects_digest: TransactionEffectsDigest,
pub effects: SuiTransactionEffects,
/// authority signature information signed by the quorum of the validators.
pub auth_sign_info: AuthorityStrongQuorumSignInfo,
Copy link
Contributor

Choose a reason for hiding this comment

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

the transaction_effects_digest and auth_sign_info duplicate the fields in SuiCertifiedTransaction, which is also part of SuiExecuteTransactionResponse. Is there any reason why we need these here?

Copy link
Contributor Author

@longbowlu longbowlu Aug 22, 2022

Choose a reason for hiding this comment

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

there's a TODO TODO: Change to CertifiedTransactionEffects eventually. in line 364.

Created an issue to track: #4207

// TODO: Change to CertifiedTransactionEffects eventually.
EffectsCert {
certificate: SuiCertifiedTransaction,
effects: SuiCertifiedTransactionEffects,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add the timestamp_ms and parsed_data here as well, as in

pub timestamp_ms: Option<u64>,
? This makes migration easier for CLI and the wallet

Copy link
Contributor Author

@longbowlu longbowlu Aug 22, 2022

Choose a reason for hiding this comment

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

does gateway return a timestamp for txn execution today? I'm curious where the timestamp is generated.

For this return struct, we are looking to add timestamp, it needs some extra work though

Copy link
Contributor

Choose a reason for hiding this comment

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

does gateway return a timestamp for txn execution today?

No.

For this return struct, we are looking to add timestamp, it needs some extra work though

got it, parsed_data is higher pri than timestamp_ms in this case. Let me take a look

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.

6 participants