CredComSoc / CreditCoopTech

Credit Coop Tech
Mozilla Public License 2.0
1 stars 1 forks source link

sending credit directly fixes #187

Closed yonasbek closed 1 year ago

dilgreen commented 1 year ago

The topic definitely is worth airing.

But I think we need clarity on what cc-node is intended to be. A federated ledger, and one that can be used, vanilla, under a wide variety of policy and use-case regimes.

The original design was to provide a suite of microservices (it's all documented), to preserve the maximum flexibility.

The ledger service was described as 'the diamond' in an attempt to capture the intent to produce a simple-as-possible transaction recording engine. Ideally, one that could be fully verified (mathematically provable, like a smart contract).

Such an engine ideally has zero configuration options. Immutable, like a diamond. One of those services you confirm the hash of before installing

Policy decisions as to validity of a transaction must therefore happen elsewhere.

Any real world service using CredCom ledger should be able to operate any policies not inconsistent with the way a CredCom ledger works. To maximise the applicability of CredCom the ledger needs to impose the smallest, least constraining set of conditions required.

So, policy can live wherever an instance designer chooses. The ledger just needs to faithfully record validated transactions.

In the Credit Coop case, I 100% agree that the UX is a bad place for policy.

I also need to say that duplicating policy operations in the same system should never happen - fundamentally an unsound architecture where inconsistency is bound to creep in. The microservice approach theoretically allows calling services on a hypothetical basis for things like pre-flight checks.

I think there is a strong case for making a validation engine as a service within the CredCom suite of services. I know that Matthew has built such a thing but at this point I don't know enough about the architecture to comment further. Meaning that, for instance, I don't really know what is meant by 'CC-node'.

Probably only Billy and John Gray have had/taken the time to acquire such knowledge

Which suggests to me, that - perhaps when there has been some initial work on documentation - we ask Matthew to do a presentation on the architecture of the reference implementation.

At which point I think discussions will be productive.

Dil

Sent from Proton Mail for iOS

On Wed, Oct 4, 2023 at 09:08, Miles Thompson @.***(mailto:On Wed, Oct 4, 2023 at 09:08, Miles Thompson < wrote:

@utunga approved this pull request.

TBH I don't fully understand all the implications of this code but it LGTM

👍

Raised a discussion over in the protocol working group discussion CredComSoc/ProtocolWorkingGroup#16 about the pros and cons of putting business logic like this up in the top of the UX layer


In sb.web.app/src/components/Members/userProfile.vue:

       this.notEnoughBkrMsg = true

} else {

  • const userSaldo = await getUserAvailableBalance(this.profileData.accountName)
  • const userLimits = await getUserLimits(this.profileData.accountName)
  • if (userSaldo.totalAvailableBalance + userLimits.min + Number(this.tkn) > userLimits.max) {
  • this.tooMuchBkrMsg = true
  • // very tricky logic. More knowledge of /saldo endpoint to understand
  • // min limit violation
  • if ((-balance.pendingBalance) + this.tkn > (-this.$store.state.user.min_limit)) {
  • this.$refs.loadingComponent.hideLoading()
  • this.actualAvailableCreditWithPending = Math.abs(this.$store.state.user.min_limit - balance.pendingBalance)
  • this.pendingBalanceLimitExceeded = true } else {

This logic should absolutely definitely not be in the UX layer at all. I have no idea how this happened.

This sort of logic belongs in the CC-Node layer I'm not sure how it ended up way up here.

That said I'm gonna approve this for now - but maybe we should file an issue to at least push it down into the server somehow.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>