Skip to content

Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
Minds Backend - Engine
Minds Backend - Engine
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Dependency List
    • Cycle Analytics
    • Insights
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
    • Locked Files
  • Issues 204
    • Issues 204
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 29
    • Merge Requests 29
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Packages
    • Packages
    • List
    • Container Registry
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Minds
  • Minds Backend - EngineMinds Backend - Engine
  • Merge Requests
  • !251

Open
Opened 1 month ago by Ben Hayward@benhayward.ben
  • Report abuse
Report abuse

[Sprint/InterestingIguana](feat): Offchain boost rate limiting #475

Closes #475

May need to distribute off-chain tokens for staging, using the php-cli. php cli.php rewards issue --username=nemofin --amount=10000

image

Edited 1 month ago by Ben Hayward

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch origin
git checkout -b feat/rate-limit-boost-475 origin/feat/rate-limit-boost-475

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git fetch origin
git checkout origin/master
git merge --no-ff feat/rate-limit-boost-475

Step 4. Push the result of the merge to GitLab

git push origin master

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

Request to merge feat/rate-limit-boost-475 into master
The source branch is 133 commits behind the target branch
Open in Web IDE
  • Email patches
  • Plain diff
Pipeline #75005327 passed for ac58cb96 on feat/rate-limit-boost-475
          Requires 2 more approvals from Devs and Deployers.
          Brian Hatchet
          Brian Hatchet
          Marcelo Rivera
          Marcelo Rivera
          Martin Santangelo
          Martin Santangelo
          Rami Albatal
          Rami Albatal
          Emiliano Balbuena
          Emiliano Balbuena
          Ready to be merged automatically. Ask someone with write access to this repository to merge this request

          Closes #475

          Deletes source branch

          • Discussion 30
          • Commits 16
          • Pipelines 15
          • Changes 5
          18/19 threads resolved
          • Loading...
          • Ben Hayward
            Ben Hayward @benhayward.ben · 1 month ago
            Developer

            Need to do some testing, and run this by somebody. Not 100% sure I've properly filtered down the transactions as the number coming out is not quite what I'd expect (though is close). Could be related to ES running under low disk constraints.

          • Mark Harding
            Mark Harding @markeharding started a thread on an old version of the diff 1 month ago
            Resolved by Ben Hayward 1 month ago
          • Mark Harding
            Mark Harding @markeharding started a thread on an old version of the diff 1 month ago
            Resolved by Ben Hayward 1 month ago
          • Mark Harding @markeharding added MR::Requires Changes scoped label 1 month ago

            added MR::Requires Changes scoped label

          • Ben Hayward @benhayward.ben added 2 commits 1 month ago

            added 2 commits

            • 6015b386 - Added in rate limits for offchain boosts.
            • ad1bd20f - Updates, refactor and added tests

            Compare with previous version

          • Ben Hayward @benhayward.ben added 1 commit 1 month ago

            added 1 commit

            • 21f43ead - Updated, added in reduce for counting impressions and extra test

            Compare with previous version

          • Ben Hayward @benhayward.ben added 2 commits 1 month ago

            added 2 commits

            • 1e8d36d4 - spacing
            • 3817cb1f - syntax

            Compare with previous version

          • Ben Hayward @benhayward.ben unmarked as a Work In Progress 1 month ago

            unmarked as a Work In Progress

          • Ben Hayward @benhayward.ben changed the description 1 month ago

            changed the description

          • Ben Hayward @benhayward.ben resolved all discussions 1 month ago

            resolved all discussions

          • Ben Hayward @benhayward.ben resolved all discussions 1 month ago

            resolved all discussions

          • Ben Hayward @benhayward.ben added MR::Awaiting Review scoped label and automatically removed MR::Requires Changes label 1 month ago

            added MR::Awaiting Review scoped label and automatically removed MR::Requires Changes label

          • Ben Hayward @benhayward.ben mentioned in issue #591 1 month ago

            mentioned in issue #591

          • Ben Hayward @benhayward.ben mentioned in issue #592 1 month ago

            mentioned in issue #592

          • Brian Hatchet :speech_balloon: @brianhatchet approved this merge request 3 weeks ago

            approved this merge request

          • Marcelo Rivera @eiennohi approved this merge request 3 weeks ago

            approved this merge request

          • Ben Hayward
            Ben Hayward @benhayward.ben · 3 weeks ago
            Developer

            @eiennohi @brianhatchet did you test with tokens? I was trying to get into this with kubectl to issue some to people. (this may have to wait till monday but if you haven't already got some, send me your usernames on staging)

          • Mark Harding @markeharding added Squad::Green scoped label 2 weeks ago

            added Squad::Green scoped label

          • Ben Hayward
            Ben Hayward @benhayward.ben · 2 weeks ago
            Developer
            1. boosted for 5000
            2. boosted dif post for 4000
            3. boosted dif post for 2000 - error
            4. boosted for 1000 - success (max of 10k now reached)
            5. boosted for 1000 - error

            image

          • Emiliano Balbuena
            Emiliano Balbuena @edgebal started a thread on an old version of the diff 2 weeks ago
            Resolved by Ben Hayward 2 weeks ago
          • Ben Hayward @benhayward.ben added 1 commit 2 weeks ago

            added 1 commit

            • 2f37b154 - added in config for max

            Compare with previous version

          • Ben Hayward @benhayward.ben added 1 commit 2 weeks ago

            added 1 commit

            • 6c616c16 - added in config for max

            Compare with previous version

          • Ben Hayward @benhayward.ben resolved all threads 2 weeks ago

            resolved all threads

          • Ben Hayward @benhayward.ben added 1 commit 2 weeks ago

            added 1 commit

            • 9f3bcb40 - fixed failing tests

            Compare with previous version

          • Brian Hatchet :speech_balloon: @brianhatchet approved this merge request 1 week ago

            approved this merge request

          • Mark Harding
            Mark Harding @markeharding started a thread on an old version of the diff 5 days ago
            Resolved by Ben Hayward 4 days ago
          • Mark Harding
            Mark Harding @markeharding started a thread on an old version of the diff 5 days ago
            Resolved by Ben Hayward 4 days ago
          • Mark Harding
            Mark Harding @markeharding started a thread on an old version of the diff 5 days ago
            Resolved by Ben Hayward 4 days ago
          • Mark Harding
            Mark Harding @markeharding started a thread on an old version of the diff 5 days ago
            Resolved by Ben Hayward 2 days ago
          • Mark Harding
            Mark Harding @markeharding started a thread on an old version of the diff 5 days ago
            Resolved by Ben Hayward 4 days ago
          • Mark Harding
            Mark Harding @markeharding started a thread on an old version of the diff 5 days ago
            Resolved by Ben Hayward 4 days ago
          • Mark Harding
            Mark Harding @markeharding started a thread on an old version of the diff 5 days ago
            Resolved by Ben Hayward 4 days ago
          • Mark Harding
            Mark Harding @markeharding started a thread on an old version of the diff 5 days ago
            Resolved by Ben Hayward 4 days ago
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 5 days ago
            Resolved by Ben Hayward 4 days ago
          • Mark Harding
            Mark Harding @markeharding started a thread on an old version of the diff 5 days ago
            Resolved by Ben Hayward 2 days ago
          • Mark Harding
            Mark Harding @markeharding started a thread on an old version of the diff 5 days ago
            Resolved by Ben Hayward 4 days ago
          • Mark Harding
            Mark Harding @markeharding started a thread on an old version of the diff 5 days ago
            Resolved by Ben Hayward 4 days ago
          • Mark Harding
            Mark Harding @markeharding started a thread on an old version of the diff 5 days ago
            Resolved by Ben Hayward 4 days ago
          • Mark Harding @markeharding added MR::Requires Changes scoped label and automatically removed MR::Awaiting Review label 5 days ago

            added MR::Requires Changes scoped label and automatically removed MR::Awaiting Review label

          • Ben Hayward @benhayward.ben added 1 commit 4 days ago

            added 1 commit

            • 0cdeb613 - updated to meet feedback

            Compare with previous version

          • Ben Hayward @benhayward.ben added 1 commit 4 days ago

            added 1 commit

            • 38602fa9 - more feedback

            Compare with previous version

          • Ben Hayward @benhayward.ben resolved all threads 4 days ago

            resolved all threads

          • Ben Hayward @benhayward.ben added MR::Awaiting Review scoped label and automatically removed MR::Requires Changes label 4 days ago

            added MR::Awaiting Review scoped label and automatically removed MR::Requires Changes label

          • Mark Harding @markeharding added MR::Requires Changes scoped label and automatically removed MR::Awaiting Review label 4 days ago

            added MR::Requires Changes scoped label and automatically removed MR::Awaiting Review label

          • Mark Harding
            Mark Harding @markeharding · 4 days ago
            Owner

            failing tests

          • Ben Hayward @benhayward.ben added 1 commit 4 days ago

            added 1 commit

            • 5358b5e3 - fixed test

            Compare with previous version

          • Mark Harding
            Mark Harding @markeharding started a thread on an old version of the diff 4 days ago
            Resolved by Ben Hayward 2 days ago
          • Mark Harding
            Mark Harding @markeharding started a thread on an old version of the diff 4 days ago
            Resolved by Ben Hayward 2 days ago
          • Ben Hayward @benhayward.ben added 1 commit 2 days ago

            added 1 commit

            • e8c67b01 - Updated to switch a function name and update reduce to have init index

            Compare with previous version

          • Ben Hayward @benhayward.ben resolved all threads 2 days ago

            resolved all threads

          • Ben Hayward @benhayward.ben added MR::Awaiting Review scoped label and automatically removed MR::Requires Changes label 2 days ago

            added MR::Awaiting Review scoped label and automatically removed MR::Requires Changes label

          • Ben Hayward @benhayward.ben added 1 commit 1 day ago

            added 1 commit

            • ab303f91 - Updated tests with new function names

            Compare with previous version

          • Mark Harding
            Mark Harding @markeharding started a thread on an old version of the diff 4 hours ago
            Last updated by Ben Hayward 29 minutes ago
            Core/Boost/Network/Manager.php
            188 $maxDaily = $this->config->get('max_daily_boost_views');
            189 return $acc + $boost->getImpressions() > $maxDaily; //still allow 10k
            190 }
            191
            192
            193 /**
            194 * Gets the users last offchain boosts, from the most recent boost backwards in time.
            195 *
            196 * @param string $type the type of the boost
            197 * @param integer $limit default to 10.
            198 * @return $existingBoosts
            199 */
            200 public function getOffchainBoosts($boost, $limit = 10) {
            201 $existingBoosts = $this->getList([
            202 'useElastic' => true,
            203 'state' => 'review',
            • Mark Harding
              Mark Harding @markeharding · 4 hours ago
              Owner

              How does this solve the '10k boosts per day' if we are only checking unapproved boosts?

            • Ben Hayward @benhayward.ben changed this line in version 13 of the diff 1 hour ago

              changed this line in version 13 of the diff

            • Ben Hayward
              Ben Hayward @benhayward.ben · 30 minutes ago
              Developer

              Replaced with active flag, as simply removing this line would then include completed, revoked and rejected.

            • Ben Hayward
              Ben Hayward @benhayward.ben · 29 minutes ago
              Developer

              How is that?

            • Please register or sign in to reply
          • Mark Harding @markeharding added MR::Requires Changes scoped label and automatically removed MR::Awaiting Review label 4 hours ago

            added MR::Requires Changes scoped label and automatically removed MR::Awaiting Review label

          • Ben Hayward @benhayward.ben added 1 commit 1 hour ago

            added 1 commit

            • 08d1d75d - expanded from just review stage to all

            Compare with previous version

          • Ben Hayward @benhayward.ben added 2 commits 36 minutes ago

            added 2 commits

            • d735c585 - updated to only apply to active boosts and requests
            • ac58cb96 - Fixing and updating tests

            Compare with previous version

          • Ben Hayward @benhayward.ben added MR::Awaiting Review scoped label and automatically removed MR::Requires Changes label 30 minutes ago

            added MR::Awaiting Review scoped label and automatically removed MR::Requires Changes label

          • You're only seeing other activity in the feed. To add a comment, switch to one of the following options.
          Please register or sign in to reply
          0 Assignees
          None
          Assign to
          None
          Milestone
          None
          Assign milestone
          None
          Time tracking
          No estimate or time spent
          2
          Labels
          MR::Awaiting Review Squad::Green
          Assign labels
          • View project labels
          Lock merge request
          Unlocked
          7
          7 participants
          user avatar
          Brian Hatchet
          user avatar
          Marcelo Rivera
          user avatar
          Martin Santangelo
          user avatar
          Rami Albatal
          user avatar
          Emiliano Balbuena
          user avatar
          Mark Harding
          user avatar
          Ben Hayward
          Reference: minds/engine!251