Skip to content

Commit

Permalink
[Gummyroll] Single authority for each tree (solana-labs#153)
Browse files Browse the repository at this point in the history
* remove append_authority from contract

* update gummyroll ts sdk

* update gummyroll tests

* remove append authority from bubblegum contract

* update bubblegum ts sdk

* Added slightly more robust logic to proof filling (solana-labs#155)

* Added more tests to gummyroll for canopy proof inference

* Change GRoll key for use on devnet

Co-authored-by: Noah Gundotra <noahgundotra@noahs-mbp.mynetworksettings.com>
Co-authored-by: Jarry Xiao <61092285+jarry-xiao@users.noreply.github.com>
Co-authored-by: jarry-xiao <jarry.xiao@gmail.com>
  • Loading branch information
4 people committed Sep 8, 2022
1 parent ffd489c commit b6d2b47
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
4 changes: 1 addition & 3 deletions contracts/sdk/gummyroll/accounts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ type MerkleRollHeader = {
maxDepth: number; // u32
maxBufferSize: number; // u32
authority: PublicKey;
appendAuthority: PublicKey;
creationSlot: BN;
};

Expand Down Expand Up @@ -83,7 +82,6 @@ export function decodeMerkleRoll(buffer: Buffer): OnChainMerkleRoll {
maxBufferSize: reader.readU32(),
maxDepth: reader.readU32(),
authority: readPublicKey(reader),
appendAuthority: readPublicKey(reader),
creationSlot: reader.readU64(),
};

Expand Down Expand Up @@ -146,7 +144,7 @@ export function getMerkleRollAccountSize(
maxBufferSize: number,
canopyDepth?: number
): number {
let headerSize = 8 + 32 + 32;
let headerSize = 8 + 32;
let changeLogSize = (maxDepth * 32 + 32 + 4 + 4) * maxBufferSize;
let rightMostPathSize = maxDepth * 32 + 32 + 4 + 4;
let merkleRollSize = 8 + 8 + 16 + changeLogSize + rightMostPathSize;
Expand Down
1 change: 0 additions & 1 deletion contracts/sdk/gummyroll/convenience.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export async function getCreateTreeIxs(
accounts: {
merkleRoll,
authority: authority.publicKey,
appendAuthority,
candyWrapper: CANDY_WRAPPER_PROGRAM_ID
},
signers: [authority],
Expand Down
2 changes: 1 addition & 1 deletion contracts/sdk/gummyroll/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export * from './convenience';
* @category constants
* @category generated
*/
export const PROGRAM_ADDRESS = 'GRoLLMza82AiYN7W9S9KCCtCyyPRAQP2ifBy4v4D5RMD'
export const PROGRAM_ADDRESS = 'GRoLLzvxpxxu2PGNJMMeZPyMxjAUH9pKqxGXV9DGiceU'

/**
* Program public key
Expand Down
8 changes: 2 additions & 6 deletions contracts/sdk/gummyroll/instructions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export function createAppendIx(
gummyroll: Program<Gummyroll>,
newLeaf: Buffer | ArrayLike<number>,
authority: Keypair,
appendAuthority: Keypair,
merkleRoll: PublicKey,
): TransactionInstruction {
return gummyroll.instruction.append(
Expand All @@ -61,10 +60,9 @@ export function createAppendIx(
accounts: {
merkleRoll,
authority: authority.publicKey,
appendAuthority: appendAuthority.publicKey,
candyWrapper: CANDY_WRAPPER_PROGRAM_ID,
},
signers: [authority, appendAuthority],
signers: [authority],
}
);
}
Expand All @@ -73,12 +71,10 @@ export function createTransferAuthorityIx(
gummyroll: Program<Gummyroll>,
authority: Keypair,
merkleRoll: PublicKey,
newAuthority: PublicKey | null,
newAppendAuthority: PublicKey | null,
newAuthority: PublicKey,
): TransactionInstruction {
return gummyroll.instruction.transferAuthority(
newAuthority,
newAppendAuthority,
{
accounts: {
merkleRoll,
Expand Down

0 comments on commit b6d2b47

Please sign in to comment.