profile
viewpoint

layer2lib/js-layer2lib 16

A javascript library for building state-channel and Plasma applications

musnit/chessocracy 1

Playing with chess/governance/state channels

ajoslin/cordova-plugin-contact-modal 0

Open the phone's "create contact" modal with some pre-filled values

finalitylabs/general-state-channels 0

Spankchain PoC implementation of generalized state channels

pull request commentSnowfork/snowbridge

Assets V2

can't u just add a check for collision too?

On Fri, Jan 21, 2022 at 1:56 PM Vincent Geddes ***@***.***> wrote:

**@. commented on this pull request.

In parachain/pallets/erc20-app/src/lib.rs https://github.com/Snowfork/snowbridge/pull/562#discussion_r789598324:

  • 	let who = T::CallOrigin::ensure_origin(origin)?;
    
  • 	if who != <Address<T>>::get() {
    
  • 		return Err(DispatchError::BadOrigin.into());
    
  • 	}
    
  • 	let asset_id = Self::make_asset_id(token);
    
  • 	T::Assets::create(asset_id, T::PalletId::get().into_account(), true, 1)?;
    
  • 	<AssetId<T>>::insert(token, asset_id);
    
  • 	Ok(())
    
  • }
    
  • }
  • impl<T: Config> Pallet<T> {
  • fn make_asset_id(address: H160) -> u128 {
    

@musnit https://github.com/musnit @alistair-singh https://github.com/alistair-singh Just want to raise a specific design implication here for discussion:

The new assets pallet uses a 128-bit number for asset identifiers. So for each new wrapped asset, we have to generate a unique 128-bit ID. The options for this generation are to either keep an incrementing counter in storage, or to generate random numbers with a very low probability of collision. I'm opting for the latter as its stateless.

So the goal of this function to generate a random 128-bit number using various sources of entropy (The contract address, last K block hashes, etc).

The probability of collision is exactly the same as the scenario where random V4 UUIDs (also 128 bits) are used as database keys. According to this wikipage https://en.wikipedia.org/wiki/Universally_unique_identifier#Collisions:

For example, the number of random version-4 UUIDs which need to be generated in order to have a 50% probability of at least one collision is 2.71 quintillion. This number is equivalent to generating 1 billion UUIDs per second for about 85 years. A file containing this many UUIDs, at 16 bytes per UUID, would be about 45 exabytes.

And

The probability to find a duplicate within 103 trillion version-4 UUIDs is one in a billion.

Given that we'll only expect to see maybe a few dozen new assets per week, our probability of collision would be several magnitudes less than the above. Practically negligible. Like we'd need to operate the bridge for hundreds or thousands of years before seeing a collision.

Currently the worst case possibility is that the transferred funds would be lost on collision.

— Reply to this email directly, view it on GitHub https://github.com/Snowfork/snowbridge/pull/562#pullrequestreview-859454152, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFVTOL3GOJSV7JVVR2XAH3UXFCXTANCNFSM5LWRTZ3A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: ***@***.***>

vgeddes

comment created time in 21 hours

push eventSnowfork/snowbridge

Aidan Musnitzky

commit sha a5704830bfc68b33c0ae784b335262f8b97c9a66

update relayer bindingsg (#565)

view details

push time in 4 days

delete branch Snowfork/snowbridge

delete branch : relayer_bindings

delete time in 4 days

PR merged Snowfork/snowbridge

Update Relayer bindings
+107 -5

0 comment

5 changed files

musnit

pr closed time in 4 days

push eventSnowfork/snowbridge

Vincent Geddes

commit sha c287001c08782ca13d1763a53f14247140eee188

Update READMEs (#564)

view details

Aidan Musnitzky

commit sha 18226d34946045152bf82119a7d0222e2a6624a0

minor dev ex improvement (#566)

view details

musnit

commit sha 77e92b709ee76e6dd290a33ee23f809d6abfc177

update relayer bindingsg

view details

push time in 4 days

push eventSnowfork/snowbridge

Aidan Musnitzky

commit sha 18226d34946045152bf82119a7d0222e2a6624a0

minor dev ex improvement (#566)

view details

push time in 4 days

delete branch Snowfork/snowbridge

delete branch : minor_fix

delete time in 4 days

PR merged Snowfork/snowbridge

minor dev ex improvement
+1 -2

0 comment

2 changed files

musnit

pr closed time in 4 days

PR opened Snowfork/snowbridge

minor dev ex improvement
+1 -2

0 comment

2 changed files

pr created time in 4 days

PR opened Snowfork/snowbridge

Update Relayer bindings
+108 -7

0 comment

7 changed files

pr created time in 4 days

create barnchSnowfork/snowbridge

branch : relayer_bindings

created branch time in 4 days

create barnchSnowfork/snowbridge

branch : minor_fix

created branch time in 4 days

PullRequestReviewEvent

Pull request review commentSnowfork/snowbridge-web

Multiple wallet support using Onboard

 export const netSlice = createSlice({   name: 'net',   initialState,   reducers: {-    setMetamaskMissing: (state) => { state.metamaskMissing = true; },     setPolkadotjsMissing: (state) => { state.polkadotJSMissing = true; },     setMetamaskNetwork: (state, action: PayloadAction<string>) => {       state.metamaskNetwork = action.payload;     },     setWeb3: (state, action: PayloadAction<Web3>) => {+      console.log('action.payload==',action.payload);

can remove?

sumitsnk

comment created time in 4 days

Pull request review commentSnowfork/snowbridge-web

Multiple wallet support using Onboard

 export default styled(TransferPanel)`   .address-display {     margin-left: 5px;   }+  .connetwallet
  .connect-wallet
sumitsnk

comment created time in 4 days

PullRequestReviewEvent

Pull request review commentSnowfork/snowbridge-web

Multiple wallet support using Onboard

 const SelectedFungibleToken = ({ className, openAssetSelector, setError }: Props       }     }     checkDepositAmount(depositAmount);+    // eslint-disable-next-line react-hooks/exhaustive-deps

fix?

sumitsnk

comment created time in 4 days

PullRequestReviewEvent

Pull request review commentSnowfork/snowbridge

Update READMEs

 The E2E tests run against local deployments of the parachain, relayer and ganach   (cd ../ethereum && yarn install)   ``` -* Development environment for the relay services. See relayer [requirements](../relayer/README.md#development).-* `timeout` - native package on Ubuntu, on macOS try ```brew install coreutils```+* Development environment for the relay services. See setup [instructions](../relayer/README.md#development). * `jq` - https://stedolan.github.io/jq/download/ * geth - https://geth.ethereum.org/docs/install-and-build/installing-geth-* sponge - Is available in the moreutils package. On Mac see https://formulae.brew.sh/formula/moreutils. On Linux:

i'd leave this in still - if ppl wanna run on mac then it's useful/helpful even though we may not put much resources into mac support

vgeddes

comment created time in 5 days

PullRequestReviewEvent

Pull request review commentSnowfork/snowbridge-web

Multiple wallet support using Onboard

 type ChainDisplayProps = {   mini?: boolean;   }-+const  onchange = () => {

unused?

sumitsnk

comment created time in 5 days

PullRequestReviewEvent

Pull request review commentSnowfork/snowbridge-web

Multiple wallet support using Onboard

 const FeeInfo = ({ className, setError }: Props) => {       }     }     checkFeeBalance(assets, swapDirection);+    // eslint-disable-next-line react-hooks/exhaustive-deps

same here

sumitsnk

comment created time in 5 days

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentSnowfork/snowbridge-web

Multiple wallet support using Onboard

 const TransferPanel = ({ className, setShowAssetSelector }: Props) => {         (errors) => ({ ...errors, gas: undefined }),       );     }+    // eslint-disable-next-line react-hooks/exhaustive-deps

i'm not sure this is a good decision/design choice - ideally we should rework the implementation so that there are no warnings?

sumitsnk

comment created time in 5 days

push eventSnowfork/braintrust-fee-converter

musnit

commit sha b42ffb8651632e6443e7fd47b8c9581d70ea8ce0

move disable comment

view details

push time in 10 days

push eventSnowfork/braintrust-fee-converter

musnit

commit sha 5457dc08b3687074c58b22708bdac951c30802ef

skip effect lint

view details

push time in 10 days

push eventSnowfork/braintrust-fee-converter

musnit

commit sha a1b586e1e4d527b59360ecb7f74f3661bc041a89

skip old requests on new input

view details

push time in 10 days

push eventSnowfork/braintrust-fee-converter

musnit

commit sha 1886821dc41a3452bb3f9b70bf67de607fcbc55b

css fix

view details

push time in 10 days

more