Commit graph

2537 commits

Author SHA1 Message Date
Kerem Kazan bf303908fa dendrite version from commit hash (#1221)
this pr computes dendrite docker version from the commit hash, instead
of bumping versions. the previous setup caused issues and conflicts when
branch protection is enabled. this way we can seamlessly keep pushing to
main and it will keep getting built and published
2023-01-13 15:39:39 -05:00
Giuseppe Rodriguez b8fd046e51 Updates UserEntitlement to take array of addresses (#1213) 2023-01-13 12:10:38 -08:00
Tak Wai Wong 7f3d10905a regenerate json addresses (#1218)
json addresses changed when i run the deploy script on a new instance of
anvil. Regenerated the json
2023-01-13 09:39:22 -08:00
Giuseppe Rodriguez e51eb13a13 0xMacro Updates (#1200)
Fixes HNT-417, HNT-411, HNT-403, HNT-398, HNT-394
2023-01-12 11:08:20 -08:00
Giuseppe Rodriguez 6745cd8162 adds multicall and updates create role with entitlements and entitlementdata arguments (#1192) 2023-01-10 19:43:14 -08:00
Tak Wai Wong 3700bcbde4 rename isEntitled to isEntitledToSpace (#1174) 2023-01-06 12:12:35 -08:00
Tak Wai Wong b09cd18803 Rename isEntitled func for channel (#1168)
Overloaded isEntitled func in ISpace.sol and Space.sol caused the generated client types to turn into string names. Renaming one of them to isEntitledToChannel.
2023-01-04 14:13:39 -08:00
Evan Salzbrenner 45185aaed0 fix space manager deployment json order (#1164) 2023-01-03 12:58:14 -08:00
texuf 1d13259cf1 New localhost contract addresses (#1160) 2023-01-02 10:38:56 -08:00
Evan Salzbrenner 83fbf169ec regenerate contract addresses (#1159) 2022-12-30 14:58:56 -08:00
Giuseppe Rodriguez 197e74169c Creates SpacesUpgrade script to update the implementation address of a space on space factory and space (#1156) 2022-12-29 20:33:41 -08:00
Automated Version Bump 0f01e2a629 ci: version bump to 1.0.38 2022-12-29 23:37:22 +00:00
Tak Wai Wong 982ce71aad fix dendrite to interact with v1 / v2 contracts (#1155)
dendrite uses commandline flag v1 or v2 to choose the smart contracts for the isEntitled check
2022-12-29 15:37:03 -08:00
Giuseppe Rodriguez d04b25996e Space v2 Updates (#1145) 2022-12-28 20:23:01 -08:00
Tak Wai Wong 751030a658 Add a config flag on dendrite to switch between zion contracts v1 / v2 (#1151)
Temporary flag to implement v2 smart contract integration. Once v2 is
done, will remove this flag.
2022-12-28 18:56:40 -08:00
Automated Version Bump f901b88c55 ci: version bump to 1.0.37 2022-12-29 01:19:25 +00:00
Automated Version Bump 01dcc1bfbc ci: version bump to 1.0.36 2022-12-29 01:08:45 +00:00
Tak Wai Wong 7baa59114b update dendrite ver to 1.0.35 (#1148)
workaround a hardcoded logic in github action that auto-bumps the
version. See
https://linear.app/hnt-labs/issue/HNT-548/github-action-that-auto-bump-dendrite-version-blocked-deployment
2022-12-28 12:26:42 -08:00
Tak Wai Wong cb002f138d bump dendrite version to 1.0.36 (#1147) 2022-12-28 11:11:16 -08:00
Giuseppe Rodriguez 6aa7e26d52 Space Manager v2 with Upgradeability (#1005) 2022-12-27 18:26:43 -08:00
Giuseppe Rodriguez f690a2ace9 deploy latest goerli (#1143) 2022-12-27 16:38:50 -08:00
Tak Wai Wong ad3be52a8d hnt-535 add modify role function to change roleName, permissions, token and user entitlement data (#1141)
- Add new functions to modify role name, permissions, token entitlement
and user entitlement with a single call
- Add new solidity tests for the new functions
- Re-generated TypeScript and Go types for both localhost and goerli
2022-12-27 14:27:02 -08:00
Tak Wai Wong 88c1b4c7b5 Refactor SpaceManager.createRole to take additional parameters (#1137)
Fixes hnt-445. This change would let the client create a new role by
paying gas 1 time instead of 8+ times.
Re-generated the localhost types
2022-12-22 12:54:46 -08:00
Kerem Kazan 1b47ba86d6 Dendrite auto publish (#1050)
- Created a package.json in servers/dendrite. Moving forward, this file
is our canonical dendrite version, and our docker builds will depend on
this version.
- Created a script that extracts the package.json version and puts it
into the GitHub actions build environment as `RELEASE_VERSION`.
- Updated the GitHub action so that it builds and publishes the docker
image to dockerhub whenever we merge dendrite changes to main.

Co-authored-by: Automated Version Bump <gh-action-bump-version@users.noreply.github.com>
2022-12-14 15:03:01 -05:00
Giuseppe Rodriguez 4586351a29 deploy latest space manager contracts (#1061)
update goerli addresses
2022-12-09 12:49:06 -08:00
Kerem Kazan 74b820079c deleted accidental package.json artifact 2022-12-07 14:59:10 -05:00
Kerem Kazan 4b35774881 e2e test failure slack notification added (#1039)
With this PR, we'll notify the `#ci` slack channel when an e2e test
fails.
2022-12-07 14:51:41 -05:00
Tak Wai Wong 8f4d1828b4 matrix room Id does not resolve to channelId or spaceId correctly (#1010)
Issue: matrix room id does not always resolve to spaceId or channelId
correctly.

Root cause: The clientApi routing endpoint and the syncapi routing
endpoint uses different stores to query for the current room states.

One is correct, the other has incomplete events. Fix the issue by using
the correct store in both routing code paths.
2022-11-30 20:12:00 -08:00
Tak Wai Wong a8127f9bdc Re-generate contract types due to ZionSpaceManger.sol changes (#1015)
- fix build-contract-types.sh to generate goerli
- re-generate types after ZionSpaceManager.sol changes.
2022-11-30 19:46:54 -08:00
Kerem Kazan dcf838c3b2 dendrite-zion.yaml added into the docker image (#965)
This PR adds the dendrite-zion.yaml into the production docker image for
dendrite
2022-11-18 18:11:48 -05:00
Tak Wai Wong 6d6c85aadc Revert from space manager when adding duplicate roleId (#948)
- space manager catches error when adding roleId to channels so that
client can get meaningful error
- Update the createChannel tests to expect the new error AddRoleFailed
- Re-generate localhost and goerli types
2022-11-16 13:43:59 -08:00
Tak Wai Wong 0f4febc65a Update script and config to start local dendrite with authorization checks (#934)
- Update the start-local-dendrite.sh to be able to start local dendrite
with / without authorization checks
- Update dendrite config to support command line arg
2022-11-16 09:05:04 -08:00
Pat Fives b9e047dfac Refactor to track roles associated with channels (#915)
update interfaces to set and remove space entitlements or channel roles

all forge tests passing

all integration tests passing
2022-11-14 20:41:25 -08:00
Tak Wai Wong 22230a238a Make module type property available in the contract + publish client types (#923)
Add the new property moduleType to EntitlementModuleInfo.

Re-generate the typescript types, Go types, and the abi
2022-11-14 10:27:34 -08:00
John Terzis 40830b8a37 Space,Channel soft deletion with dendrite gating, tests (#889)
Closes HNT-244.

The following PR implements Space,Channel soft deletion using on-chain
`disabled` flag scope to space, channel respectively. On message sync,
dendrite will now gate disabled rooms by performing a leave on the user
attempting to sync unless the user is the owner (more on this later). To
re-join, given rooms (spaces,channels) are created by default using
`invite` membership state, the owner will need to undo the on-chain
`disabled` flag, setting it false then re-invite users that left the
room as a side effect of it becoming disabled previously.

The owner does not leave the space, channel because if they did then
there would be no one left to invite users let alone themselves back in
if the action is ever undone.

What is not implemented in this PR:
1. **Transitive leaves on channels in a space** - If a space is
disabled, users will leave the space but not the channels within the
space. To allow for fully disabling a space and all its' channels, the
client can offer a view to the owner that iterates over the channels and
space to disable all on-chain. Furthermore, we could implement a batch
on-chain method that fully disables all channels within a space (plus
the space) in one on-chain call to save the owner gas.
2. **Data deletion** - No data is remove from the DAGs or on-chain.
Therefore deletion is soft and reversible.
3. **New hook to check if a room is disabled** - the client can leverage
existing on-chain public read only methods `getSpaceInfoBySpaceId`,
`getChannelInfoByChannelId` to read the state of each in order to remove
spaces, channels from a member's view that are disabled.
2022-11-09 17:07:51 -07:00
Tak Wai Wong df41f84bfa generate localhost and goerli types (#895) 2022-11-09 14:23:54 -08:00
Tak Wai Wong 29dabec35e fix copy path of the deploy script (#856) 2022-11-07 11:53:26 -08:00
Tak Wai Wong 147b17eccf write out the rolemanager address in the json (#837)
Need the address to implement the ZionRoleManagerShim

I ran this in  zion-governance/ and it worked :
forge script scripts/Local.s.sol:DeployLocal --rpc-url
http://localhost:8545/ --private-key … --broadcast

space-manager.json has the rolemanager address
2022-11-04 14:04:03 -07:00
Tak Wai Wong 78a4a213d4 Refresh dendrite with latest contract changes (#836)
sync latest dendrite main & space manager contract changes from our
fork.

Co-authored-by: Tak Wai Wong <tak@hntlabs.com>
2022-11-04 11:23:15 -07:00
Giuseppe Rodriguez 686450bdad HNT-320-321 Updates create channel to take role ids and makes contract types script simpler (#807)
Closes HNT-320

Co-authored-by: Tak Wai Wong <64229756+tak-hntlabs@users.noreply.github.com>
2022-11-03 21:35:44 -07:00
Tak Wai Wong a7ab7524da servers/dendrite Move calculation (#2856) commit 98d3f88bfb (#826) 2022-11-03 19:15:07 -07:00
Tak Wai Wong a9d3bdc058 subtree pull from dendrite fork for fix #2383 (#802)
Pull the fix for https://github.com/matrix-org/dendrite/issues/2838 into
the dendrite subtree. Includes latest dendrite main.

Signed-off-by: `Devon Hudson <devonhudson@librem.one>`
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Brian Meek <brian@hntlabs.com>
Signed-off-by: Austin Ellis <austin@hntlabs.com>
Signed-off-by: `Rubin Poster <rubinposter@gmail.com>`
Signed-off-by: `ash lea <example@thisismyactual.email>`
Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
Co-authored-by: devonh <devon.dmytro@gmail.com>
Co-authored-by: Till <2353100+S7evinK@users.noreply.github.com>
Co-authored-by: Ashley Nelson <fant@shley.email>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Brian Meek <brian@hntlabs.com>
Co-authored-by: Tak Wai Wong <takwaiw@gmail.com>
Co-authored-by: Jean Lucas <jean@4ray.co>
Co-authored-by: Kabir Kwatra <kabir@kwatra.me>
Co-authored-by: sergekh2 <gitgitgit@khorun.com>
Co-authored-by: texuf <texuf.eth@gmail.com>
Co-authored-by: kegsay <kegan@matrix.org>
Co-authored-by: Brian Meek <brian@here.video>
Co-authored-by: John Terzis <john.c.terzis@gmail.com>
Co-authored-by: John Terzis <john@hntlabs.com>
Co-authored-by: Kerem <kerem.kazan@gmail.com>
Co-authored-by: Neboer <43609792+Neboer@users.noreply.github.com>
Co-authored-by: X. Ding <dingsm@gmail.com>
Co-authored-by: dxl <dxl@plotbridge.com>
Co-authored-by: ash lea <ashkitten@users.noreply.github.com>
Co-authored-by: 0x1a8510f2 <admin@0x1a8510f2.space>
Co-authored-by: Till Faelligen <tfaelligen@gmail.com>
Co-authored-by: Till Faelligen <davidf@element.io>
2022-11-02 16:28:06 -07:00
John Terzis b4223a1a18 Jterzis/sync dendrite (#793) 2022-11-01 23:17:48 -07:00
Tak Wai Wong 424df14000 Sync dendrite fork changes for gating, and single chain support (#778)
* Latest dendrite main (8c7b274e4e)
* Gating implementation from John and Tak

Fixes for https://github.com/matrix-org/dendrite/issues/2838 and
https://github.com/matrix-org/dendrite/issues/2842

Co-authored-by: Tak Wai Wong <tak@hntlabs.com>
2022-11-01 11:09:34 -07:00
Pat Fives 6cce0b9b43 Update create space interface, allow for setting specific users and multiple tokens during space creation (#734)
This PR finishes changing all the public interfaces at the moment for
space creation and updates the client.

All integration and forge tests passing.

Local and Goerli ABIs generated.

Co-authored-by: g <5714678+giuseppecrj@users.noreply.github.com>
2022-10-26 14:00:59 -04:00
Pat Fives 4c9f469a0c Update token entitlement logic to handle multiple tokens, decode entitlement data into structs (#729)
This change updates token entitlement data structures and allows for
multiple tokens to be set for a single role, permitting the AND
operation for multiple token requirements.

It also decodes structs when creating a space and setting a new token
entitlement.

Added new tests for multiple tokens gating a role. 

Also generates localhost AND Goerli ABIs.

Forge and integration tests all pass
2022-10-25 21:02:11 -07:00
Pat Fives 322e63e912 Fixes HNT-122 Mint space nft when creating a space and use to gate via token entitlement module (#702)
Update tests to gate ownership on NFT. Verified all tests pass.
2022-10-24 18:22:20 -07:00
John Terzis 01b94a9803 Jterzis/pull dendrite fork (#712)
Co-authored-by: Tak Wai Wong <64229756+tak-hntlabs@users.noreply.github.com>
Co-authored-by: Tak Wai Wong <tak@hntlabs.com>
Co-authored-by: John Terzis <john@hntlabs.com>
2022-10-21 17:38:05 -07:00
Tak Wai Wong e0a3d62205 Integration test for Read permission (#680)
Added integration tests for the Read permission:
Test1: verifies that the token user is granted to join the space.
Test2: verifies that the non-token user is denied. But the test fails
because of this bug:
https://linear.app/hnt-labs/issue/HNT-205/createspacewithtokenentitlement-should-not-add-the-everyone-role-by

Added test util functions to facilitate the implementation of the
permission tests.

The test suite is currently disabled with "describe.skip". The test file
has comments about how to turn on gating check to run the test. Will
make this better in future PR.
2022-10-20 13:45:50 -07:00
Tak Wai Wong ce57591c65 Regenerate types due to solidity contract changes (#676)
Fix build break and re-generate the types.

yarn test passed except for the 2 unreadcount tests. Tested with sample
app. Can create space now
2022-10-19 18:54:41 -07:00