-
Notifications
You must be signed in to change notification settings - Fork 44
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
miscellaneous gauntlet deployment fixes #97
Conversation
@@ -111,6 +111,7 @@ export default class Initialize extends SolanaCommand { | |||
STATE ACCOUNTS: | |||
- State: ${state.publicKey} | |||
- Transmissions: ${transmissions} | |||
- StoreAuthority: ${storeAuthority.toString()} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used in store:set_writer
, printing for ease of use
const to = await Token.getAssociatedTokenAddress( | ||
ASSOCIATED_TOKEN_PROGRAM_ID, | ||
TOKEN_PROGRAM_ID, | ||
token.publicKey, | ||
new PublicKey(payee), | ||
) | ||
const info = await token.getAccountInfo(to) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be a misinterpretation on my end, but it seems like the payee
parameter should be a normal solana address, and then the associated token address should be calculated before checking if exists
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If to
is the associated token address, what is the info.address
then?
Ok, they are the same by looking at this client code.
Conclusion, the const info = await token.getAccountInfo(to)
LOC is unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally, what if node op did not prepare his associated token address?
The deployment will fail and be blocked, right?. So what should we do in that case?
Should we create the associated accounts (fund) on their behalf like described in this Example: Transferring tokens to another user, with sender-funding?
Why did this work before this change where we didn't check for associated acc?
- did we/they create all associated token accounts in advance?
- or does the contract creates/funds them on the first transfer?
- or we didn't even test withdrawals?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Payee address needs to be a token associated address. NodeOps created it in advance on past deployments.
You can allow sender-funding with this option
If the NodeOp didn't prepare the payee address, we prepare it for him, and run the command again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, seems like I was interpreting things incorrectly. the adminAddress
from RDD should be the associatedTokenAccount. which makes these changes incorrect, i will remove them 😄
update: removed!
gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/store/createFeed.ts
Show resolved
Hide resolved
@@ -69,8 +69,13 @@ export default class CreateFeed extends SolanaCommand { | |||
console.log(` | |||
- Decimals: ${decimals} | |||
- Description: ${description} | |||
- Live Length: ${liveLength.toNumber()} | |||
- Granularity (historical): ${granularity.toNumber()} | |||
- Total Length: ${length.toNumber()} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also compute the historical length (length - liveLength)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.