coral-xyz / multisig Goto Github PK
View Code? Open in Web Editor NEWπ Multi-signature transaction execution
License: Apache License 2.0
π Multi-signature transaction execution
License: Apache License 2.0
Hi, I've shown that multisig == on-chain tx scheduler, details here: solana-labs/solana#17218
Would be nice to expand on that and generalise the multisig framework here to the DAA (Decentralised Autonomous Agent) π
I want to send the versioned transaction through a safe address like first creating the transaction through multisig and then making this transaction object as a versioned transaction (V0) using address lookup table to send on-chain but getting the error of signature verification failed.
Please provide the example about sending the version transaction using address lookup table through safe address
anchor build
...
Now using anchor version 0.25.0.
error: no such command: `build-bpf`
View all installed commands with `cargo --list`
Find a package to install `build-bpf` with `cargo search cargo-build-bpf`
I tried 0.30.0 too - it's the same error.
We can add an account key to Transaction
which will receive SOL which were locked as account rent exemption once the transaction is executed (did_execute
will not be required anymore).
git clone https://github.com/coral-xyz/multisig
cd multisig/
cargo install --git https://github.com/coral-xyz/anchor --tag v0.28.0 anchor-cli --locked
sudo apt-get update && sudo apt-get upgrade && sudo apt-get install -y pkg-config build-essential libudev-dev
anchor --version
anchor-cli 0.28.0
anchor build
anchor test
Finished release [optimized] target(s) in 0.15s
Found a 'test' script in the Anchor.toml. Running it as a test suite!
Running test suite: "/home/andrey/valory/multisig/Anchor.toml"
multisig
1) Tests the multisig program
β Assert Unique Owners (62ms)
1 passing (1s)
1 failing
1) multisig
Tests the multisig program:
Error: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: Program failed to complete
at Connection.sendEncodedTransaction (node_modules/@solana/web3.js/lib/index.cjs.js:7339:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Connection.sendRawTransaction (node_modules/@solana/web3.js/lib/index.cjs.js:7300:20)
at async sendAndConfirmRawTransaction (node_modules/@project-serum/anchor/dist/cjs/provider.js:172:23)
at async AnchorProvider.sendAndConfirm (node_modules/@project-serum/anchor/dist/cjs/provider.js:88:20)
at async Object.rpc [as executeTransaction] (node_modules/@project-serum/anchor/dist/cjs/program/namespace/rpc.js:15:24)
at async Context.<anonymous> (tests/multisig.js:104:5)
Hi, it seems the threshold check at function create_multisig
only avoids the threshold value is not also does not fulfill the Error code InvalidThreshold
description.
Hello,
I have bumped anchor version up to 0.19.0 and created PR.
However it has been failed by Github Actions although I don't see any issues in my changes.
fyi - https://app.travis-ci.com/github/project-serum/multisig/builds/243635147#L1552
I would be appreciated if you could review and merge it.
Thank you!
Thanks for writing the multisig program (and sorry if this is the wrong venue for my question). I'm trying to understand the part where remainingAccounts
are passed to executeTransaction
:
What is the purpose of this argument? The accounts have already been set in createTransaction
and it looks like they're simply being passed again here. Could you explain the purpose of this parameter wrt to this call, and remainingAccounts
in general?
π
Changing the owner set might change the order of the owners or removes some owners entirely, which causes the signers
vec to be incorrect.
Solution: invalidate all previous transactions whenever the owners set changes. This can be done with an owner set sequencer that gets incremented everytime it changes. Each transaction can have a tagged sequence and if it doesnt match the current owner set, the transaction is deemed invalid.
anchor 0.13.0
cant be installed due to removal of branch in one of the submodules, IDL does not build with anchor 0.14.0
due to breaking changes to #[account(init)]
as detailed in this comment
the err detail is err: Transaction simulation failed: Error processing Instruction 0: account data too small for instruction
Verifiable build is using 0.13.0 docker image because Anchor.toml still contains anchor_version = "0.13.0"
error: failed to download `solana-frozen-abi v1.7.11`
Caused by:
unable to get packages from source
Caused by:
failed to parse manifest at `/Users/tpkeeper/.cargo/registry/src/github.com-1ecc6299db9ec823/solana-frozen-abi-1.7.11/Cargo.toml`
Caused by:
feature `resolver` is required
consider adding `cargo-features = ["resolver"]` to the manifest
Suppose you create a multisig where the threshold is equal to the number of owners, and you want to add an owner (and bump the threshold by one).
At this point, I donβt think there is a way to do this atomically, is there? Because a transaction only holds one Instruction
, you need to issue two calls, one for set_owners
and one for change_threshold
. If you bump the threshold first it can never be satisfied any more, so the new owner must be added before changing the threshold, which means there is a window of time in between where a non-unanimous subset of owners can execute a transaction. This set of owners can be different from the initial owners: if the new owner approves, then the transaction can be executed without consent from one of the initial owners.
This problem is not limited to the case where the number of owners is equal to the threshold, but itβs most apparent there.
One solution would be to merge set_owners
and change_threshold
into a single function. Another solution would be to allow multiple instructions in a single transaction.
the log is below
Program 11111111111111111111111111111111 invoke [1]
Program 11111111111111111111111111111111 success
Program msigmtwzgXJHj2ext4XJjCDmpbcMuufFb5cHuwg6Xdt invoke [1]
Program log: Custom program error: 0xa5
Program msigmtwzgXJHj2ext4XJjCDmpbcMuufFb5cHuwg6Xdt consumed 3591 of 200000 compute units
Program msigmtwzgXJHj2ext4XJjCDmpbcMuufFb5cHuwg6Xdt failed: custom program error: 0xa5
i have tested on local test validator, all works well.
then failed on mainnet, please help
@armaniferrante I am working with the latest code of multisig, it would be great if someone can add these files in the latest release. TIA
here is main code
const data = anchor.web3.SystemProgram.transfer({
fromPubkey: multisigSigner,
toPubkey: ownerA.publicKey,
lamports: new anchor.BN(1000000000),
}).data
const transferPid = anchor.web3.SystemProgram.programId
const transaction = anchor.web3.Keypair.generate();
const txSize = 1000; // Big enough, cuz I'm lazy.
await program.rpc.createTransaction(transferPid, accounts, data, {
accounts: {
multisig: multisig.publicKey,
transaction: transaction.publicKey,
proposer: ownerA.publicKey,
rent: anchor.web3.SYSVAR_RENT_PUBKEY,
},
instructions: [
await program.account.transaction.createInstruction(
transaction,
txSize
),
],
signers: [transaction],
});
await program.rpc.executeTransaction({
accounts: {
multisig: multisig.publicKey,
multisigSigner,
transaction: transaction.publicKey,
},
remainingAccounts:
[{
pubkey: multisig.publicKey,
isWritable: true,
isSigner: false,
}, {
pubkey: anchor.web3.SystemProgram.programId,
isWritable: true,
isSigner: false,
}, {
pubkey: multisigSigner,
isWritable: true,
isSigner: false,
}, {
pubkey: ownerA.publicKey,
isWritable: true,
isSigner: false,
}, {
pubkey: program.programId,
isWritable: true,
isSigner: false,
}],
});
Thanks for putting this together!
I'd like to run it locally but am having an issue getting it to work.
I don't understand the error I received while running this multisig example test run:
Transaction simulation failed: Error processing Instruction 1: custom program error: 0x1778
Program 11111111111111111111111111111111 invoke [1]
Program 11111111111111111111111111111111 success
Program 6tbPiQLgTU4ySYWyZGXbnVSAEzLc1uF8t5kJPXXgBmRP invoke [1]
Program log: Instruction: CreateMultisig
Program log: Custom program error: 0x1778
Program 6tbPiQLgTU4ySYWyZGXbnVSAEzLc1uF8t5kJPXXgBmRP consumed 4765 of 200000 compute units
Program 6tbPiQLgTU4ySYWyZGXbnVSAEzLc1uF8t5kJPXXgBmRP failed: custom program error: 0x1778
I followed the instructions on the README page.
If I'm doing something wrong please let me know.
Please advise, thanks.
let execute_tx;
try {
execute_tx = await `program.methods`
.executeTransaction()
.accounts({
multisig: multisigAccount.publicKey,
multisigSigner: multisigSigner,
transaction: transaction.publicKey,
})
.remainingAccounts(
accounts
// Change the signer status on the vendor signer since it's signed by the program, not the client.
.map((meta) =>
meta.pubkey.equals(multisigSigner)
? { ...meta, isSigner: false }
: meta
)
.concat({
pubkey: pid2,
isWritable: false,
isSigner: false,
})
)
// .signers([transaction, owner1])
.rpc();
error whiuile executing transaction SendTransactionError: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: Program failed to complete.
logs: [
'Program 5ehzd27DGK9cs1XHnpLVSPBFpNvaZYfNWFENEoU9h1s4 invoke [1]',
'Program log: Instruction: ExecuteTransaction',
'Program 5ehzd27DGK9cs1XHnpLVSPBFpNvaZYfNWFENEoU9h1s4 consumed 8979 of 200000 compute units',
'Program 5ehzd27DGK9cs1XHnpLVSPBFpNvaZYfNWFENEoU9h1s4 failed: Instruction passed to inner instruction is too large (18446744073709551615 > 1280)'
],
anchor -V
anchor-cli 0.29.0
I'm able to create multisig account, create raw tx and even sign the transaction but the execute transaction fails
i'm using the devnet, i see solutions to downgrade the version of solana like here:- https://solana.stackexchange.com/questions/6835/program-failed-to-complete-instruction-passed-to-inner-instruction-is-too-large
but i dont see a point as how would the cli version affect me calling methods using anchor.
although i did downgrade the version but still no luck
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.