-
Notifications
You must be signed in to change notification settings - Fork 38
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
feat!: use delegate cell lock as rollup cell lock #940
Conversation
Some gw-tools args have changed, see kicker PR:
Edit: no, need to modify |
60af8fb
to
5439a33
Compare
8160759
to
c36937f
Compare
} | ||
|
||
// Get expected type hash from args. | ||
let expected_type_hash: [u8; 32] = args.try_into().map_err(|_| Error::InvalidArgs)?; |
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.
It might be better when args can be longer than 32 bytes. Better for upgrading.
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.
What is expected to be upgraded here? It's unlikely that the length of “type hash” will change.
.position(|type_hash| type_hash == Some(expected_type_hash)) | ||
.ok_or(Error::CellDepNotFound)?; | ||
let data = load_cell_data(cell_dep_idx, Source::CellDep)?; | ||
let expected_lock_hash_160: [u8; 20] = |
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.
Same as above.
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.
How about requiring this data to:
- has a length >= 20
- and is a prefix of the lock hash
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.
IMO it is fair enough to take the first 20 bytes. There is no benefit to accepting a variant length lock hash.
let args = script.as_reader().args().raw_data(); | ||
|
||
let witness_arg = load_witness_args(0, Source::GroupInput)?; | ||
if witness_arg.as_reader().lock().is_some() { |
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.
The witness is not used in script.
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 is discussed in the internal issue. If we delegate to e.g. secp256k1/blake160, the witnesses of this lock will not be checked by it, so we added some basic sanity checks on the first witness arg.
655763d
to
a4d54ca
Compare
3abb5fe
to
205b107
Compare
@sopium please resolve conflicts |
205b107
to
69a5f0d
Compare
Use delegate cell lock to support managing block producer key via e.g. multisig lock.
Delegate cell lock is a simple lock that delegates verification to another lock via a “delegate cell”. Delegate cell can be managed separately by e.g. a multisig lock.