Coder Social home page Coder Social logo

lava's People

Contributors

0xaleksaopacic avatar amitza avatar asharibali avatar babyscope avatar candostyavuz avatar datanexus-vincent avatar dependabot[bot] avatar fire17 avatar gilxgil avatar juliansimplify avatar kagemnikarimu avatar kajeagentspi avatar lava17 avatar luis02lopez avatar nimrod-teich avatar nirtayeb avatar omerlavanet avatar oneeuroquestion avatar oren-lava avatar orenl-lava avatar praveenperera avatar ranlavanet avatar rexmilce avatar ruslanglaznyov avatar seanzor avatar shleikes avatar slandymani avatar tabakuj avatar yaroms avatar zeari avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lava's Issues

Error while building Lava v0.4.0

Expected Behavior

build success

Current Behavior

Error with following log :

make install
go install -mod=readonly -tags "netgo ledger" -ldflags '-X github.com/cosmos/cosmos-sdk/version.Name=lava -X github.com/cosmos/cosmos-sdk/version.AppName=lavad -X github.com/cosmos/cosmos-sdk/version.Version=0.4.0 -X github.com/cosmos/cosmos-sdk/version.Commit=e2c69db54ed355cb42b02a9fd21faf890f66eca8 -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo ledger, -X github.com/lavanet/lava/relayer/chainproxy.ReturnMaskedErrors=false -X github.com/lavanet/lava/utils.TimeoutMutex=false -w -s' -trimpath  ./...
# github.com/lavanet/lava/cmd/lavad
usage: link [options] main.o
  -B note
    	add an ELF NT_GNU_BUILD_ID note when using ELF
  -E entry
    	set entry symbol name
  -H type
    	set header type
  -I linker
    	use linker as ELF dynamic linker
  -L directory
    	add specified directory to library path
  -R quantum
    	set address rounding quantum (default -1)
  -T address
    	set text segment address (default -1)
  -V	print version and exit
  -X definition
    	add string value definition of the form importpath.name=value
  -a	no-op (deprecated)
  -asan
    	enable ASan interface
  -aslr
    	enable ASLR for buildmode=c-shared on windows (default true)
  -benchmark string
    	set to 'mem' or 'cpu' to enable phase benchmarking
  -benchmarkprofile base
    	emit phase profiles to base_phase.{cpu,mem}prof
  -buildid id
    	record id as Go toolchain build id
  -buildmode mode
    	set build mode
  -c	dump call graph
  -compressdwarf
    	compress DWARF if possible (default true)
  -cpuprofile file
    	write cpu profile to file
  -d	disable dynamic executable
  -debugnosplit
    	dump nosplit call graph
  -debugtextsize int
    	debug text section max size
  -debugtramp int
    	debug trampolines
  -dumpdep
    	dump symbol dependency graph
  -extar string
    	archive program for buildmode=c-archive
  -extld linker
    	use linker when linking in external mode
  -extldflags flags
    	pass flags to external linker
  -f	ignore version mismatch
  -g	disable go package data checks
  -h	halt on error
  -importcfg file
    	read import configuration from file
  -installsuffix suffix
    	set package directory suffix
  -k symbol
    	set field tracking symbol
  -libgcc string
    	compiler support lib for internal linking; use "none" to disable
  -linkmode mode
    	set link mode
  -linkshared
    	link against installed Go shared libraries
  -memprofile file
    	write memory profile to file
  -memprofilerate rate
    	set runtime.MemProfileRate to rate
  -msan
    	enable MSan interface
  -n	dump symbol table
  -o file
    	write output to file
  -pluginpath string
    	full path name for plugin
  -r path
    	set the ELF dynamic linker search path to dir1:dir2:...
  -race
    	enable race detector
  -s	disable symbol table
  -strictdups int
    	sanity check duplicate symbol contents during object file reading (1=warn 2=err).
  -tmpdir directory
    	use directory for temporary files
  -v	print link trace
  -w	disable DWARF generation
make: *** [Makefile:95: install] Error 2

Steps to Reproduce

1 - install go v1.19.4
2 - checkout lava v0.4.0
3 - make build or make install

Environment

OS and version: Debian 11

Ccc

Great product

README.md: Broken link in litepaper: needs fixing

Issue tracker is ONLY used for reporting bugs. Support or new features should be discussed on Lava's Discord channel.

Expected Behavior

When clicking on the litepaper link, the Lava litepaper should be accessible.

Current Behavior

The link is broken, leading to a 404 error page.
image

Steps to Reproduce

  1. Click the litepaper link in README.md

๐Ÿ‘‡ SECTIONS BELOW ARE NOT OBLIGATORY ๐Ÿ‘‡

Detailed Description

Possible Solution

Re-upload the litepaper to Lava or connect it with the correct link

Environment

Logs

Possible Implementation

git checkout

Issue tracker is ONLY used for reporting bugs. Support or new features should be discussed on Lava's Discord channel.

Expected Behavior

Current Behavior

Steps to Reproduce


๐Ÿ‘‡ SECTIONS BELOW ARE NOT OBLIGATORY ๐Ÿ‘‡

Detailed Description

Possible Solution

Environment

Logs

Possible Implementation

Unable to display points

Issue tracker is ONLY used for reporting bugs. Support or new features should be discussed on Lava's Discord channel.

Expected Behavior

Current Behavior

Steps to Reproduce


๐Ÿ‘‡ SECTIONS BELOW ARE NOT OBLIGATORY ๐Ÿ‘‡

Detailed Description

Possible Solution

Environment

Logs

Possible Implementation

make install failed

os: Centos 7.9
run command

# LAVA_BINARY=lavap make install
Makefile:277: *** missing separator.  Stop.

how can fix it

Contribution - Provider rewards persistency on shutdown

Reward Server

Product Requirements Document (PRD)

Title: Load Saved Payment Proofs from Disk at Start
Date: April 16, 2023
Author: Ran

Problem Statement

The current reward server saves payment proofs, but it loses all proofs when there is a reset or panic. This problem needs to be solved to ensure that the reward server can continue its operation without losing essential information.

Objective

The main objective is to enable the reward server to load saved payment proofs from disk at startup to avoid losing any data during a reset or panic.

Requirements

  1. Implement a mechanism to save payment proofs to disk periodically and securely.
  2. Enable the reward server to load saved payment proofs from disk at startup.
  3. Ensure that the saved data remains consistent and uncorrupted during the saving and loading process.
  4. Provide appropriate error handling and recovery mechanisms to deal with possible disk read/write issues.

Success Criteria

The success of this PRD will be measured by the ability of the reward server to load saved payment proofs from disk at startup without losing any data during resets or panics.

Dependencies

  • Access to the existing reward server code.

Assumptions

  • The provided reward server code is functional and does not contain any bugs or issues that would affect the implementation of the new functionality.

Constraints

  • The changes to the reward server code should not introduce any new vulnerabilities or negatively impact the performance of the system.

Out of Scope

  • Changes to the core functionality of the reward server that are unrelated to the saving and loading of payment proofs.

Milestones

  1. Design the mechanism for saving and loading payment proofs to/from disk.
  2. Implement the designed mechanism in the reward server code.
  3. Test the implemented mechanism to ensure it meets the success criteria.
  4. Deploy the updated reward server code to the production environment.

Risks

  1. Disk read/write errors could lead to corrupted or lost data.
  2. Changes to the reward server code could introduce bugs or vulnerabilities if not carefully implemented and tested.

Mitigation Strategies

  1. Implement robust error handling and recovery mechanisms to minimize the impact of disk read/write issues.
  2. Thoroughly test the implemented mechanism to ensure it works as expected and does not introduce new bugs or vulnerabilities.

Approval

@ranlavanet
@omerlavanet

Reward Server Documentation

The Reward Server package in Golang is used for managing consumer rewards and payment handling. It is designed to interact with the Lava Network.

Main Components

  1. PaymentRequest: A struct representing the payment request information.
  2. ConsumerRewards: A struct containing consumer rewards information, including proofs and data reliability proofs.
  3. EpochRewards: A struct containing the rewards for a specific epoch, mapped by consumer addresses.
  4. RewardServer: A struct that holds the main functionality of the reward server, including payment handling, updating epoch, and managing consumer rewards.
  5. RewardsTxSender: An interface that provides methods for sending relay payment transactions, getting the epoch size, and retrieving the earliest block in memory.

Main Functions

  1. PrepareRewardsForClaim: Prepares rewards and data reliability proofs for claim submission.
  2. SendNewProof: Adds a new relay session proof to the reward server.
  3. SendNewDataReliabilityProof: Adds a new data reliability proof to the reward server.
  4. UpdateEpoch: Sends rewards claims and identifies any missing payments.
  5. sendRewardsClaim: Sends rewards claims for a specific epoch.
  6. identifyMissingPayments: Identifies and logs any missing payments.
  7. gatherRewardsForClaim: Gathers rewards and data reliability proofs for a specific epoch.
  8. SubscribeStarted: Placeholder function for handling the start of a subscription.
  9. SubscribeEnded: Placeholder function for handling the end of a subscription.
  10. PaymentHandler: Handles incoming payment requests and updates the total CU paid.

How it Works

The reward server package works by managing consumer rewards in memory and submitting claims to receive rewards. The server keeps track of rewards and data reliability proofs for each consumer and epoch. When it's time to submit claims, the server gathers the rewards and proofs, sends the transactions, and removes the claimed rewards from memory. The server also handles incoming payments by updating the total CU paid and removing the expected payment from the list.

Voting end time in gov proposal doesn't match with actual end of voting

Based on discord announcement proposal โ„–32 was actually created at 2023-02-21T03:37:39 UTC+7 or 2023-02-20T21:37:39 UTC.

Screen Shot 2023-02-21 at 17 37 17

However when you take a look at the proposal details:

https://lava-testnet.nodejumper.io:1317/cosmos/gov/v1beta1/proposals/32

"voting_start_time": "2023-02-21T01:37:39.427455892Z",
"voting_end_time": "2023-02-21T13:37:39.427455892Z"

It says that voting starts at 2023-02-21T01:37:39 UTC, which is wrong and 4 hours ahead the actual creation time, voting end time is moved to 4 hours respectively, which makes explorers/bots to show misleading information.

Expected Behavior

"voting_start_time": "2023-02-20T21:37:39.427455892Z",
"voting_end_time": "2023-02-21T09:37:39.427455892Z"

Current Behavior

"voting_start_time": "2023-02-21T01:37:39.427455892Z",
"voting_end_time": "2023-02-21T13:37:39.427455892Z"

Does not compile on mac

lava/Makefile

Line 272 in 1fb2445

$(call validate_binary,$(LAVA_BINARY),\

These lines:

ifeq (,$(LAVA_BINARY))
LAVA_BINARY := bad
# these will be called if target is "build" or "install" and $(LAVA_BINARY)
# remains undefined.
build-bad install-bad docker-build-bad:
	$(error "target '$(call prefix,-,$@)' requires valid env 'LAVA_BINARY'")
else
$(call validate_binary,$(LAVA_BINARY),\
  "targets 'build'(comma) 'install' require valid env 'LAVA_BINARY'")
endif

cause this error on mac:

(base) % LAVA_BINARY=lavad make install
Makefile:284: *** "No rule to make target ''".  Stop.

I tried playing with the call syntax:

$(call validate_binary,$(LAVA_BINARY),\
  "targets 'build'(comma) 'install' require valid env 'LAVA_BINARY'")

but the make on mac does not like it. this was my fix:

ifeq (,$(LAVA_BINARY))
LAVA_BINARY := bad
# these will be called if target is "build" or "install" and $(LAVA_BINARY)
# remains undefined.
build-bad install-bad docker-build-bad:
    $(error "target '$(call prefix,-,$@)' requires valid env 'LAVA_BINARY'")
else
  $(info LAVA_BINARY is [$(LAVA_BINARY)])
  $(info valid_binaries is [$(valid_binaries)])
  
  ifeq (,$(findstring $(LAVA_BINARY),$(valid_binaries)))
  $(error "targets 'build', 'install' require valid env 'LAVA_BINARY'")
  endif
endif

And after this change it compiled:

(base) % lavad --help
Lava blockchain node daemon

Usage:
  lavad [command]

Available Commands:
  add-genesis-account Add a genesis account to genesis.json
  badgegenerator      badgegenerator sets up a server to listen for badges requests from the lava sdk and respond with a signed badge
  collect-gentxs      Collect genesis txs and output a genesis.json file
  config              Create or query an application CLI configuration file
  debug               Tool for helping with debugging your application
  export              Export state to JSON
  gentx               Generate a genesis tx carrying a self delegation
  help                Help about any command
  init                Initialize private validator, p2p, genesis, and application configuration files
  keys                Manage your application's keys
  migrate             Migrate genesis to a specified target version
  query               Querying subcommands
  rollback            rollback cosmos-sdk and tendermint state by one height
  rpcconsumer         rpcconsumer sets up a server to perform api requests and sends them through the lava protocol to data providers
  rpcprovider         rpcprovider sets up a server to listen for rpc-consumers requests from the lava protocol send them to a configured node and respond with the reply
  start               Run the full node
  status              Query remote node for status
  tendermint          Tendermint subcommands
  test                Test commands for protocol network
  tx                  Transactions subcommands
  validate-genesis    validates the genesis file at the default location or at the location passed as an arg
  version             Print the application binary version information

Flags:
  -h, --help                help for lavad
      --home string         directory for config and data (default "/Users/mikecotic/.lava")
      --log_format string   The logging format (json|plain) (default "plain")
      --log_level string    The logging level (trace|debug|info|warn|error|fatal|panic) (default "info")
      --trace               print out full stack trace on errors

Use "lavad [command] --help" for more information about a command.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.