Skip to content
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: improve error message when matching too soon [fixes DXJ-771] #908

Draft
wants to merge 84 commits into
base: main
Choose a base branch
from
Draft
Changes from 2 commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
f049327
feat: improve error message when matching to soon [fixes DXJ-771]
shamsartem Apr 15, 2024
043e713
fix
shamsartem Apr 15, 2024
881362c
fix: don't interactively ask for the env in `fluence default peers` c…
shamsartem Apr 17, 2024
e10fcc8
feat: allow adding spell to any deployment, improve validation [fixes…
shamsartem Apr 17, 2024
907b407
feat: improve offer-update logs [fixes DXJ-760] (#910)
shamsartem Apr 17, 2024
fc1c8b2
feat: retry indexer client on local network (#911)
shamsartem Apr 19, 2024
68a97e2
feat: make it possible to move noxes from one offer to another, impro…
shamsartem Apr 24, 2024
4a2f856
feat: allow selecting a deployment when creating a new service [fixes…
shamsartem Apr 25, 2024
8cc6dc2
feat: update copyright (#919)
shamsartem May 1, 2024
be7352c
chore: configured backporting support (#912)
enjenjenje May 7, 2024
1a5b336
feat: update all dependencies (#917)
shamsartem May 8, 2024
cebc439
feat: chunk CUs when withdrawing collateral, add retry for Tendermint…
shamsartem May 14, 2024
18372b7
fix: filter provider's CUs when exiting from deals. Add CU batching […
shamsartem May 15, 2024
dc796b8
chore: set s3 endpoint to region specific (#932)
enjenjenje May 15, 2024
0269c89
chore: set s3 endpoint to region specific #2
enjenjenje May 15, 2024
95d5bb3
chore: set s3 endpoint to region specific #3
enjenjenje May 15, 2024
a0a9400
chore: set s3 endpoint to region specific #4
enjenjenje May 15, 2024
9e3f204
chore: set s3 endpoint to region specific #5
enjenjenje May 15, 2024
340900a
chore: set s3 endpoint to region specific #6
enjenjenje May 15, 2024
e62b165
chore: set s3 endpoint to region specific #7
enjenjenje May 15, 2024
4217e93
chore: set s3 endpoint to region specific #8
enjenjenje May 15, 2024
133adeb
chore: set s3 endpoint to region specific #9
enjenjenje May 15, 2024
0e0ed5d
chore: set s3 endpoint to region specific #10
enjenjenje May 15, 2024
45e2df1
chore: set s3 endpoint to region specific #11
enjenjenje May 20, 2024
4654f94
chore: revert back oclif update (#944)
enjenjenje May 20, 2024
f86fbb8
feat: test improvements (#923)
shamsartem May 20, 2024
67ca200
chore(main): release fluence-cli 0.16.3 (#893)
fluencebot May 21, 2024
e83f796
feat: set up monorepo (#943)
shamsartem May 27, 2024
c1b12fc
fix: manifest path (#947)
shamsartem May 28, 2024
6e2e0db
chore: Fix e2e snapshots pulling (#948)
nahsi May 28, 2024
d15d5f7
chore: fixed typo in win promote job (#949)
enjenjenje May 30, 2024
d9e322d
chore: Update aqua-api to 0.14.9 (#952)
DieMyst Jun 7, 2024
06c9d1e
feat: update marine 0.20.1, mrepl 0.31.0 (#954)
shamsartem Jun 10, 2024
b6a84ac
feat: add json flag for provider cc-info (#955)
shamsartem Jun 10, 2024
ef7f63e
feat: local connector, linter, formatter, CI cache fix [fixes DXJ-409…
shamsartem Jun 10, 2024
0a00efe
feat: update nox 0.25.0 (#951)
kmd-fl Jun 10, 2024
1a4adc5
feat: improve redeploy message (#945)
shamsartem Jun 10, 2024
c2bf643
Update package.json
shamsartem Jun 11, 2024
f858d76
fix!: update rust toolchain and fix toolchain override (#959)
shamsartem Jun 11, 2024
7ab3a1f
fix: remove cli from monorepo (#964)
shamsartem Jun 11, 2024
7c87f38
fix: cli-connector not found (#965)
shamsartem Jun 11, 2024
9871831
Update README.md
shamsartem Jun 14, 2024
f16c2a2
fix: add cc-ids flag to provider cc-rewards-withdraw (#970)
shamsartem Jun 20, 2024
fafc236
chore(main): release fluence-cli 0.17.0 (#946)
fluencebot Jun 26, 2024
6e2292e
chore(license): switch to AGPLv3 (#971)
shamsartem Jun 26, 2024
b56b881
feat: bump deal-ts-clients 0.14.0 (#969)
justprosh Jul 1, 2024
362e068
chore: Dump anvil state only with label and on failure (#974)
nahsi Jul 4, 2024
6c5f329
feat: use rust-toolchain.toml (#975)
shamsartem Jul 8, 2024
86b39e6
feat: add human-readable messages to the CLI connector (#976)
shamsartem Jul 9, 2024
8f3f4f6
fix: documentation links in configs (#977)
shamsartem Jul 9, 2024
c63eedf
feat: add health check to graph-node (#981)
shamsartem Jul 12, 2024
4eac711
feat: allow deploying to all CU of peer ids [BRND-13] (#982)
shamsartem Jul 12, 2024
74b3003
chore(deps): deal-ts-clients 0.14.3 (#983)
folex Jul 17, 2024
982b7a9
fix(deps): ts-clients 0.15.0, diamond on stage (#986)
folex Jul 24, 2024
33fdd61
fix(deps): deal-ts-clients 0.15.1, diamond on Dar (#987)
folex Jul 26, 2024
fb7e6db
chore(deps): update nox docker tag to v0.25.1 (#984)
renovate[bot] Jul 26, 2024
0fe3986
chore(main): release fluence-cli 0.17.1 (#972)
fluencebot Jul 26, 2024
9416f32
fix(deps): fluence-network-environment 1.2.2 (#989)
folex Jul 30, 2024
f48e5b5
feat(deps, provider): deal-ts-clients 0.15.2, integrate new collatera…
folex Aug 2, 2024
585d3c6
feat(kras)!: switch kras chain to raas (#993)
folex Aug 7, 2024
1a1a4d3
fix(cli-connector): switch chain networks reliably, fix connector not…
shamsartem Aug 8, 2024
a63df1e
feat: add provider test (#980)
shamsartem Aug 8, 2024
62b70c4
feat: offer-info updates [fixes DXJ-770] (#906)
shamsartem Aug 9, 2024
5aacb77
feat: nox diamond update, update aqua-lib 0.11.0 (#995)
shamsartem Aug 12, 2024
ecd080d
fix(deps): deal-ts-clients 0.15.4, new stage & testnet contracts (#996)
folex Aug 12, 2024
d17ec22
fix: don't ensure rust when showing versions (#999)
shamsartem Aug 13, 2024
e02766c
chore(main): release fluence-cli 0.18.0 (#990)
fluencebot Aug 13, 2024
f6b4430
fix: add retry to getting offers info from indexer when offer is crea…
shamsartem Aug 14, 2024
6d68e06
chore: Use centralized renovate configs (#1003)
nahsi Aug 15, 2024
5997610
feat(marketplace)!: many CUs in a worker (#1001)
shamsartem Aug 22, 2024
7854cd5
chore(main): release fluence-cli 0.19.0 (#1000)
fluencebot Aug 22, 2024
51e7358
fix(chain): update chain uris to .fluence.dev domains (#1007)
folex Aug 29, 2024
ed351f5
feat(vm): add vmConfig to computePeer.nox (#1009)
folex Aug 29, 2024
df4697d
chore(main): release fluence-cli 0.19.1 (#1013)
fluencebot Aug 29, 2024
0f1f5fa
feat: use pinned IPFS container version, other improvements (#1006)
shamsartem Aug 29, 2024
70ba028
chore(ci): add choice options to promote (#1015)
folex Aug 29, 2024
b5413ee
fix(vm_config): add hostSshPort and vmSshPort to Nox's vmConfig (#1016)
folex Sep 2, 2024
c7c0f61
fix(provider): rename rewardDelegationRate to stakerReward (#1017)
folex Sep 3, 2024
0656244
chore(main): release fluence-cli 0.19.2 (#1014)
fluencebot Sep 3, 2024
0c65c19
feat: don't require connecting wallet on provider info if provider ad…
shamsartem Sep 4, 2024
48cc5ad
feat: add offer-remove command (#1018)
shamsartem Sep 4, 2024
dda06c8
feat!: update default ports (#1021)
shamsartem Sep 4, 2024
f9e3ca1
Update README.md
shamsartem Sep 5, 2024
4befac9
feat: up deal-ts-clients, show additional cc-info for providers (#1023)
shamsartem Sep 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions src/lib/deal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,17 +189,33 @@ export async function dealUpdate({ dealAddress, appCID }: DealUpdateArg) {
}

export async function match(dealAddress: string) {
const { dealClient } = await getDealClient();
const { readonlyDealClient } = await getReadonlyDealClient();
const dealMatcherClient = await getDealMatcherClient();
dbg(`running getMatchedOffersByDealId with dealAddress: ${dealAddress}`);
const core = dealClient.getCore();
const core = readonlyDealClient.getCore();
const currentEpoch = await core.currentEpoch();

dbg(
`initTimestamp: ${bigintToStr(
await core.initTimestamp(),
)} Current epoch: ${bigintToStr(await core.currentEpoch())}`,
)} Current epoch: ${bigintToStr(currentEpoch)}`,
);

// TODO: get this from chain
const lastMatchedEpoch: bigint = 0n;
const minDealRematchingEpochs = await core.minDealRematchingEpochs();

if (
!(
lastMatchedEpoch === 0n ||
currentEpoch > lastMatchedEpoch + minDealRematchingEpochs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure about this sign,

also, there are updated on the part of the ts-client: https://github.com/fluencelabs/deal/pull/429

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am taking this logic right from the contracts, basically I think I have the same condition as in solidity code. You can check it out and confirm if I am correct

)
) {
commandObj.error(
`You have to wait at least ${bigintToStr(minDealRematchingEpochs)} epochs before you can match again. You previously matched on epoch ${bigintToStr(lastMatchedEpoch)}`,
);
}

const matchedOffers = await setTryTimeout(
"get matched offers by deal id",
() => {
Expand All @@ -219,6 +235,7 @@ export async function match(dealAddress: string) {

dbg(`got matchedOffers: ${stringifyUnknown(matchedOffers)}`);

const { dealClient } = await getDealClient();
const market = dealClient.getMarket();

const matchDealTxReceipt = await sign(
Expand Down
Loading