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

Generate natspec to suavelib #218

Merged
merged 2 commits into from
Mar 12, 2024
Merged

Generate natspec to suavelib #218

merged 2 commits into from
Mar 12, 2024

Conversation

ferranbt
Copy link
Collaborator

📝 Summary

This PR adds description fields to structs and fields and generates the natspec description for each field in the Suave.sol library.

📚 References


  • I have seen and agree to CONTRIBUTING.md

@@ -120,6 +161,12 @@ library Suave {
}
}

/// @notice Constructs an Ethereum block based on the provided `bidIds`. The construction follows the order of `bidId`s are given.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// @notice Constructs an Ethereum block based on the provided `bidIds`. The construction follows the order of `bidId`s are given.
/// @notice Constructs an Ethereum block based on the provided `bidIds`. The construction follows the order of `bidId`s.

@@ -141,6 +190,10 @@ library Suave {
return data;
}

/// @notice Retrieves data from the confidential store. Also mandates the caller's presence in the `AllowedPeekers` list.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// @notice Retrieves data from the confidential store. Also mandates the caller's presence in the `AllowedPeekers` list.
/// @notice Retrieves data from the confidential store. Also mandates the caller's presence in the `AllowedPeekers` list.

@@ -150,13 +203,20 @@ library Suave {
return data;
}

/// @notice Handles the storage of data in the confidential store. Requires the caller to be part of the `AllowedPeekers` for the associated bid.
Copy link
Contributor

Choose a reason for hiding this comment

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

"Handles the storage" is unclear -- would "Stores data in the confidential store?" be clearer?

@@ -203,6 +277,9 @@ library Suave {
return abi.decode(data, (DataRecord[]));
}

/// @notice Joins the user's transaction and with the backrun, and returns encoded mev-share bundle. The bundle is ready to be sent via `SubmitBundleJsonRPC`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// @notice Joins the user's transaction and with the backrun, and returns encoded mev-share bundle. The bundle is ready to be sent via `SubmitBundleJsonRPC`.
/// @notice Joins the user's transaction and with the backrun, and returns encoded mev-share bundle. The bundle is ready to be sent via `SubmitBundleJsonRPC`.

@@ -301,6 +409,11 @@ library Suave {
return abi.decode(data, (SimulateTransactionResult));
}

/// @notice Submits bytes as JSONRPC message to the specified URL with the specified method. As this call is intended for bundles, it also signs the params and adds `X-Flashbots-Signature` header, as usual with bundles. Regular eth bundles don't need any processing to be sent.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// @notice Submits bytes as JSONRPC message to the specified URL with the specified method. As this call is intended for bundles, it also signs the params and adds `X-Flashbots-Signature` header, as usual with bundles. Regular eth bundles don't need any processing to be sent.
/// @notice Submits bytes as JSONRPC message to the specified URL with the specified method. As this call is intended for bundles, it also signs the params and adds `X-Flashbots-Signature` header, as usual with bundles. Regular eth bundles don't need any processing to be sent.

@@ -222,6 +301,12 @@ library Suave {
return abi.decode(data, (string));
}

/// @notice Initializes data records within the ConfidentialStore. Prior to storing data, all bids should undergo initialization via this precompile.
Copy link
Contributor

Choose a reason for hiding this comment

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

is "bid" still the right term here?

Comment on lines 349 to 353
/// @notice Signs an Ethereum Transaction, 1559 or Legacy, and returns raw signed transaction bytes. `txn` is binary encoding of the transaction. `signingKey` is hex encoded string of the ECDSA private key *without the 0x prefix*. `chainId` is a hex encoded string *with 0x prefix*.
/// @param txn Transaction to sign encoded in RLP
/// @param chainId Id of the chain to sign for
/// @param signingKey Hex encoded string of the ECDSA private key
/// @return signedTxn Signed transaction encoded in RLP
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// @notice Signs an Ethereum Transaction, 1559 or Legacy, and returns raw signed transaction bytes. `txn` is binary encoding of the transaction. `signingKey` is hex encoded string of the ECDSA private key *without the 0x prefix*. `chainId` is a hex encoded string *with 0x prefix*.
/// @param txn Transaction to sign encoded in RLP
/// @param chainId Id of the chain to sign for
/// @param signingKey Hex encoded string of the ECDSA private key
/// @return signedTxn Signed transaction encoded in RLP
/// @notice Signs an Ethereum Transaction, 1559 or Legacy, and returns raw signed transaction bytes. `txn` is binary encoding of the transaction.
/// @param txn Transaction to sign (RLP encoded)
/// @param chainId Id of the chain to sign for (hex encoded, with 0x prefix)
/// @param signingKey Hex encoded string of the ECDSA private key (without 0x prefix)
/// @return signedTxn Signed transaction encoded in RLP

Copy link
Contributor

@metachris metachris left a comment

Choose a reason for hiding this comment

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

lgtm, left a few minor comments

@ferranbt ferranbt merged commit 4fbf043 into main Mar 12, 2024
4 checks passed
@ferranbt ferranbt deleted the feature/add-natspec-suavelib branch March 12, 2024 11:19
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.

2 participants